[brasero] Reset GCancellable object before any GIO operation to make sure it wasn't cancelled earlier.



commit 63ba92e25e3f601f88625d072867b373e22a60a4
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Fri Jul 31 16:00:55 2009 +0200

    Reset GCancellable object before any GIO operation to make sure it wasn't cancelled earlier.

 libbrasero-media/brasero-volume.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)
---
diff --git a/libbrasero-media/brasero-volume.c b/libbrasero-media/brasero-volume.c
index b523156..6953f34 100644
--- a/libbrasero-media/brasero-volume.c
+++ b/libbrasero-media/brasero-volume.c
@@ -232,6 +232,11 @@ brasero_volume_umount (BraseroVolume *volume,
 	gvolume = brasero_volume_get_gvolume (volume);
 	if (!gvolume)
 		return TRUE;
+
+	if (g_cancellable_is_cancelled (priv->cancel)) {
+		BRASERO_MEDIA_LOG ("Resetting GCancellable object");
+		g_cancellable_reset (priv->cancel);
+	}
 
 	result = brasero_gio_operation_umount (gvolume,
 					       priv->cancel,
@@ -277,6 +282,11 @@ brasero_volume_mount (BraseroVolume *volume,
 	gvolume = brasero_volume_get_gvolume (volume);
 	if (!gvolume)
 		return TRUE;
+
+	if (g_cancellable_is_cancelled (priv->cancel)) {
+		BRASERO_MEDIA_LOG ("Resetting GCancellable object");
+		g_cancellable_reset (priv->cancel);
+	}
 
 	result = brasero_gio_operation_mount (gvolume,
 					      parent_window,
@@ -303,7 +313,10 @@ brasero_volume_cancel_current_operation (BraseroVolume *volume)
 	g_return_if_fail (volume != NULL);
 	g_return_if_fail (BRASERO_IS_VOLUME (volume));
 
-	priv = BRASERO_VOLUME_PRIVATE (volume);	
+	priv = BRASERO_VOLUME_PRIVATE (volume);
+
+	BRASERO_MEDIA_LOG ("Cancelling volume operation");
+
 	g_cancellable_cancel (priv->cancel);
 }
 
@@ -440,6 +453,7 @@ brasero_volume_finalize (GObject *object)
 
 	priv = BRASERO_VOLUME_PRIVATE (object);
 
+	BRASERO_MEDIA_LOG ("Finalizing Volume object");
 	if (priv->cancel) {
 		g_cancellable_cancel (priv->cancel);
 		g_object_unref (priv->cancel);



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