gthumb r2537 - in trunk: . libgthumb src



Author: mjc
Date: Wed Apr  8 01:04:25 2009
New Revision: 2537
URL: http://svn.gnome.org/viewvc/gthumb?rev=2537&view=rev

Log:
Merged 2535:2536 from gthumb-2-10 to fix memory leaks.


Modified:
   trunk/   (props changed)
   trunk/ChangeLog
   trunk/NEWS
   trunk/libgthumb/pixbuf-utils.c
   trunk/src/dlg-bookmarks.c
   trunk/src/dlg-catalog.c
   trunk/src/dlg-comment.c
   trunk/src/dlg-duplicates.c
   trunk/src/dlg-png-exporter.c
   trunk/src/dlg-scripts.c

Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS	(original)
+++ trunk/NEWS	Wed Apr  8 01:04:25 2009
@@ -73,6 +73,7 @@
 	* Made the OK button the default widget in the rename dialog.
 	* The existing import scripts did not properly unmount gvfs-mounted
         cameras. Gnome bug #560352, Ubuntu bug #351122.
+	* Fixed various small memory leaks, bug #578282.
 
 
 version 2.10.11

Modified: trunk/libgthumb/pixbuf-utils.c
==============================================================================
--- trunk/libgthumb/pixbuf-utils.c	(original)
+++ trunk/libgthumb/pixbuf-utils.c	Wed Apr  8 01:04:25 2009
@@ -662,6 +662,7 @@
 			     GDK_PIXBUF_ERROR,
 			     GDK_PIXBUF_ERROR_INSUFFICIENT_MEMORY,
 			     "Couldn't allocate memory for loading JPEG file");
+		fclose (file);
 		return FALSE;
 	}
 
@@ -674,6 +675,7 @@
 	if (sigsetjmp (jerr.setjmp_buffer, 1)) {
 		jpeg_destroy_compress (&cinfo);
 		g_free (buf);
+		fclose (file);
 		return FALSE;
 	}
 

Modified: trunk/src/dlg-bookmarks.c
==============================================================================
--- trunk/src/dlg-bookmarks.c	(original)
+++ trunk/src/dlg-bookmarks.c	Wed Apr  8 01:04:25 2009
@@ -272,15 +272,16 @@
 
 	data = g_new0 (DialogData, 1);
 
-	data->browser = browser;
-	data->do_not_update = FALSE;
-
 	data->gui = glade_xml_new (GTHUMB_GLADEDIR "/" GLADE_FILE, NULL, NULL);
         if (! data->gui) {
                 g_warning ("Could not find " GLADE_FILE "\n");
+		g_free (data);
                 return;
         }
 
+	data->browser = browser;
+	data->do_not_update = FALSE;
+
 	/* Get the widgets. */
 
 	data->dialog = glade_xml_get_widget (data->gui, "bookmarks_dialog");

Modified: trunk/src/dlg-catalog.c
==============================================================================
--- trunk/src/dlg-catalog.c	(original)
+++ trunk/src/dlg-catalog.c	Wed Apr  8 01:04:25 2009
@@ -279,6 +279,13 @@
 
 	data = g_new (DialogData, 1);
 
+	data->gui = glade_xml_new (GTHUMB_GLADEDIR "/" GLADE_FILE, NULL, NULL);
+	if (! data->gui) {
+		g_warning ("Could not find " GLADE_FILE "\n");
+		g_free (data);
+		return;
+        }
+
 	data->window = window;
 	data->cat_list = catalog_list_new (FALSE);
 	data->data.list = list;
@@ -290,12 +297,6 @@
 	} else
 		data->current_dir = get_catalog_full_path (NULL);
 
-	data->gui = glade_xml_new (GTHUMB_GLADEDIR "/" GLADE_FILE, NULL, NULL);
-	if (! data->gui) {
-		g_warning ("Could not find " GLADE_FILE "\n");
-		return;
-        }
-
 	/* Get the widgets. */
 
 	data->dialog = glade_xml_get_widget (data->gui, "catalog_dialog");
@@ -447,18 +448,19 @@
 
 	data = g_new (DialogData, 1);
 
-	data->window = window;
-	data->current_dir = get_catalog_full_path (NULL);
-	data->cat_list = catalog_list_new (FALSE);
-	catalog_list_show_dirs_only (data->cat_list, TRUE);
-	data->data.catalog_path = catalog_path;
-
 	data->gui = glade_xml_new (GTHUMB_GLADEDIR "/" GLADE_FILE, NULL, NULL);
 	if (! data->gui) {
 		g_warning ("Could not find " GLADE_FILE "\n");
+		g_free (data);
 		return;
         }
 
+	data->window = window;
+	data->current_dir = get_catalog_full_path (NULL);
+	data->cat_list = catalog_list_new (FALSE);
+	catalog_list_show_dirs_only (data->cat_list, TRUE);
+	data->data.catalog_path = catalog_path;
+
 	/* Get the widgets. */
 
 	data->dialog = glade_xml_get_widget (data->gui, "catalog_dialog");

Modified: trunk/src/dlg-comment.c
==============================================================================
--- trunk/src/dlg-comment.c	(original)
+++ trunk/src/dlg-comment.c	Wed Apr  8 01:04:25 2009
@@ -365,14 +365,15 @@
 
 	data = g_new0 (DialogData, 1);
 
-	data->window = window;
-
 	data->gui = glade_xml_new (GTHUMB_GLADEDIR "/" GLADE_FILE , NULL, NULL);
         if (!data->gui) {
                 g_warning ("Could not find " GLADE_FILE "\n");
+		g_free (data);
                 return NULL;
         }
 
+	data->window = window;
+
 	/* Get the widgets. */
 
 	data->dialog = glade_xml_get_widget (data->gui, "comments_dialog");

Modified: trunk/src/dlg-duplicates.c
==============================================================================
--- trunk/src/dlg-duplicates.c	(original)
+++ trunk/src/dlg-duplicates.c	Wed Apr  8 01:04:25 2009
@@ -769,15 +769,15 @@
 
 	data = g_new0 (DialogData, 1);
 
-	data->browser = browser;
-	data->gui = glade_xml_new (GTHUMB_GLADEDIR "/" GLADE_FILE, NULL,
-				   NULL);
-
+	data->gui = glade_xml_new (GTHUMB_GLADEDIR "/" GLADE_FILE, NULL, NULL);
 	if (! data->gui) {
 		g_warning ("Could not find " GLADE_FILE "\n");
+		g_free (data);
 		return;
 	}
 
+	data->browser = browser;
+
 	/* Get the widgets. */
 
 	data->dialog = glade_xml_get_widget (data->gui, "duplicates_dialog");

Modified: trunk/src/dlg-png-exporter.c
==============================================================================
--- trunk/src/dlg-png-exporter.c	(original)
+++ trunk/src/dlg-png-exporter.c	Wed Apr  8 01:04:25 2009
@@ -1329,6 +1329,7 @@
 	data->gui = glade_xml_new (GTHUMB_GLADEDIR "/" GLADE_EXPORTER_FILE, NULL, NULL);
         if (!data->gui) {
                 g_warning ("Could not find " GLADE_EXPORTER_FILE "\n");
+		g_free (data);
                 return;
         }
 

Modified: trunk/src/dlg-scripts.c
==============================================================================
--- trunk/src/dlg-scripts.c	(original)
+++ trunk/src/dlg-scripts.c	Wed Apr  8 01:04:25 2009
@@ -503,11 +503,10 @@
 	data = g_new0 (ProgressData, 1);
 
 	/* Add a progress indicator */
-	data->gui = glade_xml_new (GTHUMB_GLADEDIR "/" SCRIPT_GLADE_FILE, NULL,
-                                   NULL);
-
+	data->gui = glade_xml_new (GTHUMB_GLADEDIR "/" SCRIPT_GLADE_FILE, NULL, NULL);
         if (!data->gui) {
                 g_warning ("Could not find " SCRIPT_GLADE_FILE "\n");
+		g_free (data);
                 return;
         }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]