From ae69a754244c4e475c8d2591772ca8e005071d83 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 18 Feb 2019 11:55:41 +0100 Subject: Update to 5.42 --- hacks/glx/photopile.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'hacks/glx/photopile.c') 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 */ -- cgit v1.2.3-55-g7522