projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
From http://www.jwz.org/xscreensaver/xscreensaver-5.37.tar.gz
[xscreensaver]
/
hacks
/
glx
/
hydrostat.c
diff --git
a/hacks/glx/hydrostat.c
b/hacks/glx/hydrostat.c
index 85aea634cc5ba141682f5f048dc5293fa36b5d80..776df0a7db3229ef4a222199d6f723ccd17fc7f2 100644
(file)
--- a/
hacks/glx/hydrostat.c
+++ b/
hacks/glx/hydrostat.c
@@
-34,6
+34,7
@@
"*suppressRotationAnimation: True\n" \
# define refresh_hydrostat 0
"*suppressRotationAnimation: True\n" \
# define refresh_hydrostat 0
+# define release_hydrostat 0
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
#undef countof
#define countof(x) (sizeof((x))/sizeof((*x)))
@@
-640,6
+641,8
@@
hydrostat_handle_event (ModeInfo *mi, XEvent *event)
}
}
+static void free_hydrostat (ModeInfo *mi);
+
ENTRYPOINT void
init_hydrostat (ModeInfo *mi)
{
ENTRYPOINT void
init_hydrostat (ModeInfo *mi)
{
@@
-647,14
+650,7
@@
init_hydrostat (ModeInfo *mi)
hydrostat_configuration *bp;
int i;
hydrostat_configuration *bp;
int i;
- if (!bps) {
- bps = (hydrostat_configuration *)
- calloc (MI_NUM_SCREENS(mi), sizeof (hydrostat_configuration));
- if (!bps) {
- fprintf(stderr, "%s: out of memory\n", progname);
- exit(1);
- }
- }
+ MI_INIT (mi, bps, free_hydrostat);
bp = &bps[MI_SCREEN(mi)];
bp = &bps[MI_SCREEN(mi)];
@@
-763,11
+759,13
@@
draw_hydrostat (ModeInfo *mi)
}
}
-
ENTRYPOINT
void
-
releas
e_hydrostat (ModeInfo *mi)
+
static
void
+
fre
e_hydrostat (ModeInfo *mi)
{
hydrostat_configuration *bp = &bps[MI_SCREEN(mi)];
int i;
{
hydrostat_configuration *bp = &bps[MI_SCREEN(mi)];
int i;
+ if (!bp->squids)
+ return;
for (i = 0; i < MI_COUNT(mi); i++)
free_squid (bp->squids[i]);
free (bp->squids);
for (i = 0; i < MI_COUNT(mi); i++)
free_squid (bp->squids[i]);
free (bp->squids);