diff src/slideshow.c @ 89:b3149a34d0dd

Sat Oct 28 14:41:10 2006 John Ellis <johne@verizon.net> * img-view.c: Use correct method to close the window using Escape key, fixes bug #1231845. Also added more robust method to update window list when a window is closed so this doesn't happen again. * slideshow.c: Add sanity checks to exported functions to check for NULL SlideShow pointers, to match rest of coding style.
author gqview
date Sat, 28 Oct 2006 18:49:38 +0000
parents d907d608745f
children 197b8d2e52ce
line wrap: on
line diff
--- a/src/slideshow.c	Sat Oct 28 00:03:15 2006 +0000
+++ b/src/slideshow.c	Sat Oct 28 18:49:38 2006 +0000
@@ -25,6 +25,8 @@
 
 void slideshow_free(SlideShowData *ss)
 {
+	if (!ss) return;
+
 	slideshow_timer_reset(ss, FALSE);
 
 	if (ss->stop_func) ss->stop_func(ss, ss->stop_data);
@@ -118,6 +120,8 @@
 	const gchar *imd_path;
 	const gchar *path;
 
+	if (!ss) return FALSE;
+
 	imd_path = image_get_path(ss->imd);
 
 	if ( ((imd_path == NULL) != (ss->slide_path == NULL)) ||
@@ -284,6 +288,8 @@
 
 void slideshow_next(SlideShowData *ss)
 {
+	if (!ss) return;
+
 	if (!slideshow_step(ss, TRUE))
 		{
 		slideshow_free(ss);
@@ -295,6 +301,8 @@
 
 void slideshow_prev(SlideShowData *ss)
 {
+	if (!ss) return;
+
 	if (!slideshow_step(ss, FALSE))
 		{
 		slideshow_free(ss);