summaryrefslogtreecommitdiffstats
path: root/hacks/glx/starwars.c
diff options
context:
space:
mode:
authorSimon Rettberg2019-02-18 11:55:58 +0100
committerSimon Rettberg2019-02-18 11:55:58 +0100
commitaa7530630e595b80d5db54655fd827b61edc0fd7 (patch)
tree048cb74072450c7592f254c3537ac8f252d09d73 /hacks/glx/starwars.c
parentForgot one DPMS killing instance (diff)
parentUpdate to 5.42 (diff)
downloadxscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.tar.gz
xscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.tar.xz
xscreensaver-aa7530630e595b80d5db54655fd827b61edc0fd7.zip
Merge branch 'master' into openslxv23
Diffstat (limited to 'hacks/glx/starwars.c')
-rw-r--r--hacks/glx/starwars.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/hacks/glx/starwars.c b/hacks/glx/starwars.c
index 1efcd15..bccd568 100644
--- a/hacks/glx/starwars.c
+++ b/hacks/glx/starwars.c
@@ -896,7 +896,7 @@ draw_sws (ModeInfo *mi)
return;
glDrawBuffer (GL_BACK);
- glXMakeCurrent (dpy, window, *(sc->glx_context));
+ glXMakeCurrent (dpy, window, *sc->glx_context);
glClear (GL_COLOR_BUFFER_BIT);
@@ -1057,10 +1057,18 @@ ENTRYPOINT void
free_sws (ModeInfo *mi)
{
sws_configuration *sc = &scs[MI_SCREEN(mi)];
- if (sc->tc)
- textclient_close (sc->tc);
-
- /* #### there's more to free here */
+ int i;
+ if (!sc->glx_context) return;
+ glXMakeCurrent (MI_DISPLAY(mi), MI_WINDOW(mi), *sc->glx_context);
+ if (sc->tc) textclient_close (sc->tc);
+ if (sc->texfont) free_texture_font (sc->texfont);
+ if (sc->buf) free (sc->buf);
+ if (sc->line_widths) free (sc->line_widths);
+ for (i = 0; i < sc->total_lines; i++)
+ if (sc->lines[i]) free (sc->lines[i]);
+ if (sc->lines) free (sc->lines);
+ if (glIsList(sc->star_list)) glDeleteLists(sc->star_list, 1);
+ if (glIsList(sc->text_list)) glDeleteLists(sc->text_list, 1);
}