(storage_weak_notify): Set

the storage member to NULL.
(shell_weak_notify): Set the shell member to NULL.
(cleanup_discovery): g_object_weak_unref() shell, parent and
storage.

svn path=/trunk/; revision=21280
This commit is contained in:
Ettore Perazzoli
2003-05-20 15:22:41 +00:00
parent 42333eed03
commit 6f02daa384
2 changed files with 27 additions and 0 deletions

View File

@ -1,3 +1,13 @@
2003-05-20 Ettore Perazzoli <ettore@ximian.com>
[#43322]
* e-shell-shared-folder-picker-dialog.c (storage_weak_notify): Set
the storage member to NULL.
(shell_weak_notify): Set the shell member to NULL.
(cleanup_discovery): g_object_weak_unref() shell, parent and
storage.
2003-05-19 Ettore Perazzoli <ettore@ximian.com> 2003-05-19 Ettore Perazzoli <ettore@ximian.com>
* main.c: Removed "forced_upgrade" unused variable. * main.c: Removed "forced_upgrade" unused variable.

View File

@ -292,6 +292,10 @@ show_dialog (EShell *shell,
/* Discovery process. */ /* Discovery process. */
static void shell_weak_notify (void *data, GObject *where_the_object_was);
static void shell_view_weak_notify (void *data, GObject *where_the_object_was);
static void storage_weak_notify (void *data, GObject *where_the_object_was);
struct _DiscoveryData { struct _DiscoveryData {
EShell *shell; EShell *shell;
EShellView *parent; EShellView *parent;
@ -308,6 +312,15 @@ cleanup_discovery (DiscoveryData *discovery_data)
if (discovery_data->dialog != NULL) if (discovery_data->dialog != NULL)
gtk_widget_destroy (discovery_data->dialog); gtk_widget_destroy (discovery_data->dialog);
if (discovery_data->shell != NULL)
g_object_weak_unref (G_OBJECT (discovery_data->shell), shell_weak_notify, discovery_data);
if (discovery_data->parent != NULL)
g_object_weak_unref (G_OBJECT (discovery_data->parent), shell_view_weak_notify, discovery_data);
if (discovery_data->storage != NULL)
g_object_weak_unref (G_OBJECT (discovery_data->storage), storage_weak_notify, discovery_data);
g_free (discovery_data->user_email_address); g_free (discovery_data->user_email_address);
g_free (discovery_data->folder_name); g_free (discovery_data->folder_name);
g_object_unref (discovery_data->storage); g_object_unref (discovery_data->storage);
@ -406,6 +419,8 @@ shell_weak_notify (void *data,
DiscoveryData *discovery_data; DiscoveryData *discovery_data;
discovery_data = (DiscoveryData *) data; discovery_data = (DiscoveryData *) data;
discovery_data->shell = NULL;
cleanup_discovery (discovery_data); cleanup_discovery (discovery_data);
} }
@ -426,6 +441,8 @@ storage_weak_notify (void *data,
DiscoveryData *discovery_data; DiscoveryData *discovery_data;
discovery_data = (DiscoveryData *) data; discovery_data = (DiscoveryData *) data;
discovery_data->storage = NULL;
cleanup_discovery (discovery_data); cleanup_discovery (discovery_data);
/* FIXME: Should we signal the user when this happens? I.e. when the /* FIXME: Should we signal the user when this happens? I.e. when the