changeset 119:197b8d2e52ce

Thu Nov 30 09:55:42 2006 John Ellis <johne@verizon.net> * slideshow.c (real_slideshow_start): Fix memory leak when unable to begin a slideshow.
author gqview
date Thu, 30 Nov 2006 14:58:27 +0000
parents ac0f7f942c4d
children f0ecfb80be38
files ChangeLog TODO src/slideshow.c
diffstat 3 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Nov 30 03:56:25 2006 +0000
+++ b/ChangeLog	Thu Nov 30 14:58:27 2006 +0000
@@ -1,3 +1,8 @@
+Thu Nov 30 09:55:42 2006  John Ellis  <johne@verizon.net>
+
+	* slideshow.c (real_slideshow_start): Fix memory leak when unable to
+	begin a slideshow.
+
 Wed Nov 29 22:53:03 2006  John Ellis  <johne@verizon.net>
 
 	* image-overlay.[ch]: Prepare for icon notification display, and fix
--- a/TODO	Thu Nov 30 03:56:25 2006 +0000
+++ b/TODO	Thu Nov 30 14:58:27 2006 +0000
@@ -117,7 +117,9 @@
 Minor (non blockers):
 ----------------------------------------------
 
- > fix gtk_table_attach use to not use FALSE for fill vertical arg.
+d> fix memory leak in real_slideshow_start() when slideshow_step fails.
+
+d> fix gtk_table_attach use to not use FALSE for fill vertical arg.
 
  > xv and xpaint are hardly used or even installed by any distro anymore - time
    to remove these (and find alternates?) seems silly to only have gimp.
--- a/src/slideshow.c	Thu Nov 30 03:56:25 2006 +0000
+++ b/src/slideshow.c	Thu Nov 30 14:58:27 2006 +0000
@@ -336,11 +336,9 @@
 
 	ss->from_selection = FALSE;
 
-	ss->stop_func = stop_func;
-	ss->stop_data = stop_data;
+	ss->stop_func = NULL;
 
 	ss->timeout_id = -1;
-
 	ss->paused = FALSE;
 
 	if (ss->path_list)
@@ -382,9 +380,13 @@
 	if (slideshow_step(ss, TRUE))
 		{
 		slideshow_timer_reset(ss, TRUE);
+
+		ss->stop_func = stop_func;
+		ss->stop_data = stop_data;
 		}
 	else
 		{
+		slideshow_free(ss);
 		ss = NULL;
 		}