[emerillon] Don't save the window position on subsequent dispose() calls
- From: Łukasz Jernaś <ljernas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [emerillon] Don't save the window position on subsequent dispose() calls
- Date: Fri, 28 May 2010 12:13:50 +0000 (UTC)
commit 484fab0d0ba761e1f4e2164275941d827bdc4fad
Author: Å?ukasz JernaÅ? <deejay1 srem org>
Date: Fri May 28 14:06:38 2010 +0200
Don't save the window position on subsequent dispose() calls
Dispose might be called multiple times so gconf_client_set_int()
might be called on an already destroyed client. To avoid this, check
if self->priv->client isn't null and then save the parameters.
emerillon/window.c | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/emerillon/window.c b/emerillon/window.c
index bb6c7a2..0dd6ce5 100644
--- a/emerillon/window.c
+++ b/emerillon/window.c
@@ -266,13 +266,6 @@ emerillon_window_dispose (GObject *object)
EmerillonWindow *self = EMERILLON_WINDOW (object);
gint width, height;
- /* Save the window size */
- gtk_window_get_size (GTK_WINDOW (self), &width, &height);
- width = gconf_client_set_int (self->priv->client,
- EMERILLON_CONF_UI_WINDOW_WIDTH, width, NULL);
- height = gconf_client_set_int (self->priv->client,
- EMERILLON_CONF_UI_WINDOW_HEIGHT, height, NULL);
-
if (self->priv->main_actions != NULL)
{
g_object_unref (self->priv->main_actions);
@@ -280,11 +273,18 @@ emerillon_window_dispose (GObject *object)
}
if (self->priv->client)
- {
- gconf_client_remove_dir (self->priv->client, EMERILLON_CONF_DIR, NULL);
- g_object_unref (self->priv->client);
- self->priv->client = NULL;
- }
+ {
+ /* Save the window size */
+ gtk_window_get_size (GTK_WINDOW (self), &width, &height);
+ width = gconf_client_set_int (self->priv->client,
+ EMERILLON_CONF_UI_WINDOW_WIDTH, width, NULL);
+ height = gconf_client_set_int (self->priv->client,
+ EMERILLON_CONF_UI_WINDOW_HEIGHT, height, NULL);
+
+ gconf_client_remove_dir (self->priv->client, EMERILLON_CONF_DIR, NULL);
+ g_object_unref (self->priv->client);
+ self->priv->client = NULL;
+ }
if (self->priv->geoclue_client)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]