summaryrefslogtreecommitdiffstats
path: root/hacks/glx/glslideshow.c
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/glx/glslideshow.c')
-rw-r--r--hacks/glx/glslideshow.c32
1 files changed, 21 insertions, 11 deletions
diff --git a/hacks/glx/glslideshow.c b/hacks/glx/glslideshow.c
index 77c741c..0edc1eb 100644
--- a/hacks/glx/glslideshow.c
+++ b/hacks/glx/glslideshow.c
@@ -388,8 +388,8 @@ destroy_image (ModeInfo *mi, image *img)
int i;
if (!img) abort();
- if (!img->loaded_p) abort();
- if (!img->used_p) abort();
+ /* if (!img->loaded_p) abort(); */
+ /* if (!img->used_p) abort(); */
if (img->texid <= 0) abort();
if (img->refcount != 0) abort();
@@ -1200,6 +1200,10 @@ draw_slideshow (ModeInfo *mi)
new_sprite (mi);
if (!ss->redisplay_needed_p)
+ /* Nothing to do! Don't bother drawing a texture or even swapping the
+ frame buffers. Note that this means that the FPS display will be
+ wrong: "Load" will be frozen on whatever it last was, when in
+ reality it will be close to 0. */
return;
if (debug_p && ss->now - ss->prev_frame_time > 1)
@@ -1222,21 +1226,27 @@ ENTRYPOINT void
free_slideshow (ModeInfo *mi)
{
slideshow_state *ss = &sss[MI_SCREEN(mi)];
- int i;
+ /* int i; */
if (!ss->glx_context) return;
glXMakeCurrent(MI_DISPLAY(mi), MI_WINDOW(mi), *ss->glx_context);
if (ss->font_data) free_texture_font (ss->font_data);
- for (i = 0; i < ss->nimages; i++) {
- if (ss->images[i]) {
- if (ss->images[i]->title) free (ss->images[i]->title);
- if (ss->images[i]->texid) glDeleteTextures (1, &ss->images[i]->texid);
- free (ss->images[i]);
- }
+ ss->font_data = 0;
+
+# if 0
+ /* The lifetime of these objects is incomprehensible.
+ Doing this causes free pointers to be run from the XtInput.
+ */
+ for (i = ss->nimages-1; i >= 0; i--) {
+ if (ss->images[i] && ss->images[i]->refcount == 0)
+ destroy_image (mi, ss->images[i]);
}
- for (i = 0; i < countof(ss->sprites); i++) {
- if (ss->sprites[i]) free (ss->sprites[i]);
+
+ for (i = countof(ss->sprites)-1; i >= 0; i--) {
+ if (ss->sprites[i])
+ destroy_sprite (mi, ss->sprites[i]);
}
+# endif
}
XSCREENSAVER_MODULE_2 ("GLSlideshow", glslideshow, slideshow)