X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=driver%2Fsplash.c;h=4a5ff73375d03b6c53c3bdf4d0163bafe699987d;hb=4cecfc89e5e889c7232693897c06168fb378bd5c;hp=0ae76a4a3dc1b59850cbc5bbcda8af663c6789e1;hpb=8eb2873d7054e705c4e83f22d18c40946a9e2529;p=xscreensaver diff --git a/driver/splash.c b/driver/splash.c index 0ae76a4a..4a5ff733 100644 --- a/driver/splash.c +++ b/driver/splash.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1991-2001 Jamie Zawinski +/* xscreensaver, Copyright (c) 1991-2002 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -645,6 +645,7 @@ destroy_splash_window (saver_info *si) if (sp->heading_label) free (sp->heading_label); if (sp->body_label) free (sp->body_label); + if (sp->body2_label) free (sp->body2_label); if (sp->demo_label) free (sp->demo_label); #ifdef PREFS_BUTTON if (sp->prefs_label) free (sp->prefs_label); @@ -670,14 +671,17 @@ destroy_splash_window (saver_info *si) if (sp->logo_pixmap) XFreePixmap (si->dpy, sp->logo_pixmap); - if (sp->logo_npixels && sp->logo_pixels) - XFreeColors (si->dpy, cmap, sp->logo_pixels, sp->logo_npixels, 0L); if (sp->logo_pixels) - free (sp->logo_pixels); + { + if (sp->logo_npixels) + XFreeColors (si->dpy, cmap, sp->logo_pixels, sp->logo_npixels, 0L); + free (sp->logo_pixels); + sp->logo_pixels = 0; + sp->logo_npixels = 0; + } memset (sp, 0, sizeof(*sp)); free (sp); - si->sp_data = 0; } @@ -728,6 +732,7 @@ handle_splash_event (saver_info *si, XEvent *event) if (which && sp->pressed == which) { destroy_splash_window (si); + sp = si->sp_data; switch (which) { case 1: do_demo (si); break; @@ -743,8 +748,9 @@ handle_splash_event (saver_info *si, XEvent *event) /* click and release on the window but not in a button: treat that as "dismiss the splash dialog." */ destroy_splash_window (si); + sp = si->sp_data; } - sp->pressed = 0; + if (sp) sp->pressed = 0; update_splash_window (si); } break;