summaryrefslogtreecommitdiffstats
path: root/hacks/glx/discoball.c
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/glx/discoball.c')
-rw-r--r--hacks/glx/discoball.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/hacks/glx/discoball.c b/hacks/glx/discoball.c
index 4085c56..427d7e9 100644
--- a/hacks/glx/discoball.c
+++ b/hacks/glx/discoball.c
@@ -637,7 +637,7 @@ draw_ball (ModeInfo *mi)
if (!bp->glx_context)
return;
- glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(bp->glx_context));
+ glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *bp->glx_context);
glShadeModel(GL_SMOOTH);
@@ -693,13 +693,17 @@ ENTRYPOINT void
free_ball (ModeInfo *mi)
{
ball_configuration *bp = &bps[MI_SCREEN(mi)];
+ if (!bp->glx_context) return;
+ glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *bp->glx_context);
while (bp->tiles)
{
tile *t = bp->tiles->next;
free (bp->tiles);
bp->tiles = t;
}
- free (bp->rays);
+ if (bp->rays) free (bp->rays);
+ if (bp->trackball) gltrackball_free (bp->trackball);
+ if (bp->rot) free_rotator (bp->rot);
}
XSCREENSAVER_MODULE_2 ("Discoball", discoball, ball)