gnome-scan r513 - in trunk: . lib



Author: bersace
Date: Tue Feb 26 15:24:32 2008
New Revision: 513
URL: http://svn.gnome.org/viewvc/gnome-scan?rev=513&view=rev

Log:
Fixed leaks.


Modified:
   trunk/ChangeLog
   trunk/lib/gnome-scan-acquisition-dialog.c
   trunk/lib/gnome-scan-dialog.c

Modified: trunk/lib/gnome-scan-acquisition-dialog.c
==============================================================================
--- trunk/lib/gnome-scan-acquisition-dialog.c	(original)
+++ trunk/lib/gnome-scan-acquisition-dialog.c	Tue Feb 26 15:24:32 2008
@@ -54,10 +54,11 @@
 {
   GnomeScanJob	*job;
 	
-  GtkWidget	*progressbar;
-  GtkWidget	*state_label;
-  GtkWidget	*forward;
-  GThread*	job_thread;
+	GtkWidget	*progressbar;
+	GtkWidget	*state_label;
+	GtkWidget	*forward;
+	GThread*	job_thread;
+	gboolean	disposed;
 };
 
 enum
@@ -155,6 +156,18 @@
 }
 
 static void
+gnome_scan_acquisition_dialog_dispose (GObject *object)
+{
+	GnomeScanAcquisitionDialogPrivate *priv = GET_PRIVATE(object);
+	
+	if (!priv->disposed) {
+		g_object_unref(priv->job);
+		priv->disposed = TRUE;
+	}
+	
+  G_OBJECT_CLASS (parent_class)->finalize (object);
+}
+static void
 gnome_scan_acquisition_dialog_finalize (GObject *object)
 {
   G_OBJECT_CLASS (parent_class)->finalize (object);
@@ -206,6 +219,7 @@
 
   g_type_class_add_private (klass, sizeof (GnomeScanAcquisitionDialogPrivate));
   object_class->finalize = gnome_scan_acquisition_dialog_finalize;
+  object_class->finalize = gnome_scan_acquisition_dialog_dispose;
   object_class->set_property = gnome_scan_acquisition_dialog_set_property;
   object_class->get_property = gnome_scan_acquisition_dialog_get_property;
 

Modified: trunk/lib/gnome-scan-dialog.c
==============================================================================
--- trunk/lib/gnome-scan-dialog.c	(original)
+++ trunk/lib/gnome-scan-dialog.c	Tue Feb 26 15:24:32 2008
@@ -533,6 +533,7 @@
 		g_object_get (dialog, "transient-for", &parent, NULL);
 		acquisition_dialog = gnome_scan_acquisition_dialog_new (parent, priv->job);
 		gnome_scan_acquisition_dialog_run (GNOME_SCAN_ACQUISITION_DIALOG (acquisition_dialog));
+		gtk_widget_destroy(acquisition_dialog);
 	}
 	
 	return;



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