summaryrefslogtreecommitdiffstats
path: root/hacks/glx/photopile.c
diff options
context:
space:
mode:
authorSimon Rettberg2019-02-18 11:55:41 +0100
committerSimon Rettberg2019-02-18 11:55:41 +0100
commitae69a754244c4e475c8d2591772ca8e005071d83 (patch)
tree58b3fa7abc2dcfe3c23e1c0ce108950c720826ab /hacks/glx/photopile.c
parentUpdate gitignore (diff)
downloadxscreensaver-ae69a754244c4e475c8d2591772ca8e005071d83.tar.gz
xscreensaver-ae69a754244c4e475c8d2591772ca8e005071d83.tar.xz
xscreensaver-ae69a754244c4e475c8d2591772ca8e005071d83.zip
Update to 5.42
Diffstat (limited to 'hacks/glx/photopile.c')
-rw-r--r--hacks/glx/photopile.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/hacks/glx/photopile.c b/hacks/glx/photopile.c
index e060f25..01d18d6 100644
--- a/hacks/glx/photopile.c
+++ b/hacks/glx/photopile.c
@@ -31,7 +31,6 @@
"*chooseRandomImages: True \n" \
"*suppressRotationAnimation: True\n" \
-# define free_photopile 0
# define release_photopile 0
# define photopile_handle_event xlockmore_no_events
@@ -471,6 +470,7 @@ hack_resources (Display *dpy)
value.addr = buf2;
value.size = strlen(buf2);
XrmPutResource (&db, buf1, "String", &value);
+ free (val);
# endif /* !HAVE_JWXYZ */
}
@@ -730,7 +730,7 @@ draw_photopile (ModeInfo *mi)
if (!ss->glx_context)
return;
- glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *(ss->glx_context));
+ glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *ss->glx_context);
if (ss->mode == EARLY)
if (loading_initial_image (mi))
@@ -828,6 +828,24 @@ draw_photopile (ModeInfo *mi)
glXSwapBuffers (MI_DISPLAY (mi), MI_WINDOW(mi));
}
+
+ENTRYPOINT void
+free_photopile (ModeInfo *mi)
+{
+ photopile_state *ss = &sss[MI_SCREEN(mi)];
+ if (!ss->glx_context) return;
+ glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *ss->glx_context);
+ if (ss->frames) {
+ int i;
+ for (i = 0; i < MI_COUNT(mi); i++) {
+ if (ss->frames[i].title) free (ss->frames[i].title);
+ if (ss->frames[i].texid) glDeleteTextures(1, &ss->frames[i].texid);
+ }
+ }
+ if (ss->shadow) glDeleteTextures(1, &ss->shadow);
+ if (ss->texfont) free_texture_font (ss->texfont);
+}
+
XSCREENSAVER_MODULE ("Photopile", photopile)
#endif /* USE_GL */