summaryrefslogtreecommitdiff
path: root/graphics/gtkam/patches/patch-ab
blob: ed74eeb3d188fd5b9ffecf3a7540b6f17a869157 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
$NetBSD: patch-ab,v 1.4 2007/08/19 10:53:19 obache Exp $

--- src/gtkam-delete.c.orig	2006-12-14 18:38:12.000000000 +0000
+++ src/gtkam-delete.c
@@ -178,11 +178,13 @@ delete_all (GtkamDelete *delete, GtkamCa
 	GtkamDeleteAllDeletedData add;
 	GtkamDeleteFileDeletedData fdd;
 
+	result = gp_list_new (&l1);
+	if (result < GP_OK)
+		return FALSE;
 	s = gtkam_status_new (_("Deleting all files in '%s'..."), folder);
 	gtk_widget_show (s);
 	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (delete)->vbox), s,
 			    FALSE, FALSE, 0);
-	gp_list_new (&l1);
 	r1 = gp_camera_folder_list_files (camera->camera, folder, l1, NULL);
 	result = gp_camera_folder_delete_all (camera->camera, folder,
 					GTKAM_STATUS (s)->context->context);
@@ -193,9 +195,11 @@ delete_all (GtkamDelete *delete, GtkamCa
 		g_signal_emit (G_OBJECT (delete),
 			signals[ALL_DELETED], 0, &add);
 		gtk_object_destroy (GTK_OBJECT (s));
+                gp_list_unref(l1);
 		return (TRUE);
 	case GP_ERROR_CANCEL:
 		gtk_object_destroy (GTK_OBJECT (s));
+                gp_list_unref(l1);
 		return (TRUE);
 	default:
 		d = gtkam_error_new (result, GTKAM_STATUS (s)->context,
@@ -221,10 +225,10 @@ delete_all (GtkamDelete *delete, GtkamCa
 				}
 			}
 		}
+		gp_list_unref (l1);
 		gp_list_unref (l2);
 		return (FALSE);
 	}
-	gp_list_unref (l1);
 }
 
 static gboolean