brasero r1239 - in trunk: . src



Author: philippr
Date: Wed Sep  3 12:30:25 2008
New Revision: 1239
URL: http://svn.gnome.org/viewvc/brasero?rev=1239&view=rev

Log:
	Fixed a memleak when importing sessions in data projects

	* src/brasero-data-session.c (brasero_data_session_add_last):
	* src/brasero-file-node.c
	(brasero_file_node_destroy_with_children):
	* src/burn-volume-source.c:
	* src/burn-volume-source.h:


Modified:
   trunk/ChangeLog
   trunk/src/brasero-data-session.c
   trunk/src/brasero-file-node.c
   trunk/src/burn-volume-source.c
   trunk/src/burn-volume-source.h

Modified: trunk/src/brasero-data-session.c
==============================================================================
--- trunk/src/brasero-data-session.c	(original)
+++ trunk/src/brasero-data-session.c	Wed Sep  3 12:30:25 2008
@@ -30,6 +30,8 @@
 #include "burn-basics.h"
 #include "burn-caps.h"
 
+#include "scsi-device.h"
+
 #include "burn-drive.h"
 
 #include "brasero-data-session.h"
@@ -115,7 +117,9 @@
 			       GError **error)
 {
 	BraseroDataSessionPrivate *priv;
+	BraseroDeviceHandle *handle;
 	BraseroVolFile *volume;
+	BraseroScsiErrCode err;
 	BraseroMedium *medium;
 	const gchar *device;
 	BraseroVolSrc *vol;
@@ -146,13 +150,23 @@
 	}
 
 	device = brasero_drive_get_device (priv->drive);
-	vol = brasero_volume_source_open_device_path (device, error);
+	handle = brasero_device_handle_open (device, &err);
+	if (!handle) {
+		g_set_error (error,
+			     BRASERO_BURN_ERROR,
+			     BRASERO_BURN_ERROR_GENERAL,
+			     brasero_scsi_strerror (err));
+		return FALSE;
+	}
+
+	vol = brasero_volume_source_open_device_handle (handle, error);
 	volume = brasero_volume_get_files (vol,
 					   block,
 					   NULL,
 					   NULL,
 					   NULL,
 					   error);
+	brasero_device_handle_close (handle);
 	brasero_volume_source_close (vol);
 	if (*error) {
 		if (volume)

Modified: trunk/src/brasero-file-node.c
==============================================================================
--- trunk/src/brasero-file-node.c	(original)
+++ trunk/src/brasero-file-node.c	Wed Sep  3 12:30:25 2008
@@ -1006,7 +1006,7 @@
 	BraseroFileNode *next;
 	BraseroImport *import;
 	BraseroGraft *graft;
-g_print ("DEESTROYING %s %i\n", BRASERO_FILE_NODE_NAME (node), node->is_grafted);
+
 	/* destroy all children recursively */
 	for (child = BRASERO_FILE_NODE_CHILDREN (node); child; child = next) {
 		next = child->next;

Modified: trunk/src/burn-volume-source.c
==============================================================================
--- trunk/src/burn-volume-source.c	(original)
+++ trunk/src/burn-volume-source.c	Wed Sep  3 12:30:25 2008
@@ -315,25 +315,6 @@
 	return src;
 }
 
-BraseroVolSrc *
-brasero_volume_source_open_device_path (const gchar *path,
-					GError **error)
-{
-	BraseroScsiErrCode err;
-	BraseroDeviceHandle *handle;
-
-	handle = brasero_device_handle_open (path, &err);
-	if (!handle) {
-		g_set_error (error,
-			     BRASERO_BURN_ERROR,
-			     BRASERO_BURN_ERROR_GENERAL,
-			     brasero_scsi_strerror (err));
-		return NULL;
-	}
-
-	return brasero_volume_source_open_device_handle (handle, error);
-}
-
 void
 brasero_volume_source_ref (BraseroVolSrc *vol)
 {

Modified: trunk/src/burn-volume-source.h
==============================================================================
--- trunk/src/burn-volume-source.h	(original)
+++ trunk/src/burn-volume-source.h	Wed Sep  3 12:30:25 2008
@@ -61,10 +61,6 @@
 brasero_volume_source_open_device_handle (BraseroDeviceHandle *handle,
 					  GError **error);
 BraseroVolSrc *
-brasero_volume_source_open_device_path (const gchar *path,
-					GError **error);
-
-BraseroVolSrc *
 brasero_volume_source_open_file (const gchar *path,
 				 GError **error);
 BraseroVolSrc *



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