brasero r1240 - in trunk: . src
- From: philippr svn gnome org
- To: svn-commits-list gnome org
- Subject: brasero r1240 - in trunk: . src
- Date: Wed, 3 Sep 2008 13:41:20 +0000 (UTC)
Author: philippr
Date: Wed Sep 3 13:41:19 2008
New Revision: 1240
URL: http://svn.gnome.org/viewvc/brasero?rev=1240&view=rev
Log:
Fixed a crash when the operation was cancelled while it is in wait loop
* src/burn.c (brasero_burn_wakeup), (brasero_burn_sleep),
(brasero_burn_cancel), (brasero_burn_finalize):
Modified:
trunk/ChangeLog
trunk/src/burn.c
trunk/src/scsi-write-page.h
Modified: trunk/src/burn.c
==============================================================================
--- trunk/src/burn.c (original)
+++ trunk/src/burn.c Wed Sep 3 13:41:19 2008
@@ -59,6 +59,7 @@
BraseroBurnSession *session;
GMainLoop *sleep_loop;
+ guint timeout_id;
guint tasks_done;
guint task_nb;
@@ -200,6 +201,7 @@
if (priv->sleep_loop)
g_main_loop_quit (priv->sleep_loop);
+ priv->timeout_id = 0;
return FALSE;
}
@@ -207,16 +209,24 @@
brasero_burn_sleep (BraseroBurn *burn, gint msec)
{
BraseroBurnPrivate *priv = BRASERO_BURN_PRIVATE (burn);
+ GMainLoop *loop;
priv->sleep_loop = g_main_loop_new (NULL, FALSE);
- g_timeout_add (msec,
- (GSourceFunc) brasero_burn_wakeup,
- burn);
+ priv->timeout_id = g_timeout_add (msec,
+ (GSourceFunc) brasero_burn_wakeup,
+ burn);
- g_main_loop_run (priv->sleep_loop);
+ /* Keep a reference to the loop in case we are cancelled to destroy it */
+ loop = priv->sleep_loop;
+ g_main_loop_run (loop);
+ if (priv->timeout_id) {
+ g_source_remove (priv->timeout_id);
+ priv->timeout_id = 0;
+ }
+
+ g_main_loop_unref (loop);
if (priv->sleep_loop) {
- g_main_loop_unref (priv->sleep_loop);
priv->sleep_loop = NULL;
return BRASERO_BURN_OK;
}
@@ -2499,6 +2509,11 @@
priv = BRASERO_BURN_PRIVATE (burn);
+ if (priv->timeout_id) {
+ g_source_remove (priv->timeout_id);
+ priv->timeout_id = 0;
+ }
+
if (priv->sleep_loop) {
g_main_loop_quit (priv->sleep_loop);
priv->sleep_loop = NULL;
@@ -2515,6 +2530,11 @@
{
BraseroBurnPrivate *priv = BRASERO_BURN_PRIVATE (object);
+ if (priv->timeout_id) {
+ g_source_remove (priv->timeout_id);
+ priv->timeout_id = 0;
+ }
+
if (priv->sleep_loop) {
g_main_loop_quit (priv->sleep_loop);
priv->sleep_loop = NULL;
Modified: trunk/src/scsi-write-page.h
==============================================================================
--- trunk/src/scsi-write-page.h (original)
+++ trunk/src/scsi-write-page.h Wed Sep 3 13:41:19 2008
@@ -27,6 +27,8 @@
/**
* Write Parameters Page
+ * This mode page is useful for CD-R, CD-RW (not MRW formatted), DVD-R, and
+ * DVD-RW media. Not for DVD+R(W)/DVD-RAM.
*/
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]