[gnome-disk-utility/udisks2-port] Don't access destroyed widgets
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-disk-utility/udisks2-port] Don't access destroyed widgets
- Date: Thu, 5 Jan 2012 19:42:27 +0000 (UTC)
commit dea2f1e75a192296ff95a601e789973b8321420f
Author: David Zeuthen <davidz redhat com>
Date: Thu Jan 5 14:42:14 2012 -0500
Don't access destroyed widgets
Signed-off-by: David Zeuthen <davidz redhat com>
src/palimpsest/gdurestorediskimagedialog.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/palimpsest/gdurestorediskimagedialog.c b/src/palimpsest/gdurestorediskimagedialog.c
index 2733418..76fcbf0 100644
--- a/src/palimpsest/gdurestorediskimagedialog.c
+++ b/src/palimpsest/gdurestorediskimagedialog.c
@@ -42,6 +42,8 @@ typedef struct
{
volatile gint ref_count;
+ gboolean destroying;
+
GduWindow *window;
UDisksObject *object;
UDisksBlock *block;
@@ -89,6 +91,7 @@ restore_disk_image_data_unref (RestoreDiskImageData *data)
{
if (g_atomic_int_dec_and_test (&data->ref_count))
{
+ data->destroying = TRUE;
if (data->dialog != NULL)
{
gtk_widget_hide (data->dialog);
@@ -128,6 +131,9 @@ restore_disk_image_update (RestoreDiskImageData *data)
gchar *restore_error = NULL;
GFile *restore_file = NULL;
+ if (data->destroying)
+ goto out;
+
/* don't update if we're already copying */
if (data->buffer != NULL)
goto out;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]