[gimp] app: keep a ref to the session info in gimp_session_info_restore()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: keep a ref to the session info in gimp_session_info_restore()
- Date: Thu, 12 May 2011 20:00:57 +0000 (UTC)
commit 9e60dd547dd307cfec95a597dd5536e486e7e871
Author: Michael Natterer <mitch gimp org>
Date: Thu May 12 20:53:21 2011 +0200
app: keep a ref to the session info in gimp_session_info_restore()
because failing to restore a dock can destroy the newly created dock
and implicitly unref the session info.
app/widgets/gimpsessioninfo.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
---
diff --git a/app/widgets/gimpsessioninfo.c b/app/widgets/gimpsessioninfo.c
index 052ca73..8f718ba 100644
--- a/app/widgets/gimpsessioninfo.c
+++ b/app/widgets/gimpsessioninfo.c
@@ -467,6 +467,8 @@ gimp_session_info_restore (GimpSessionInfo *info,
g_return_if_fail (GIMP_IS_SESSION_INFO (info));
g_return_if_fail (GIMP_IS_DIALOG_FACTORY (factory));
+ g_object_ref (info);
+
display = gdk_display_get_default ();
if (info->p->screen != DEFAULT_SCREEN)
@@ -512,6 +514,8 @@ gimp_session_info_restore (GimpSessionInfo *info,
factory,
screen,
GIMP_DOCK_WINDOW (dialog));
+
+ g_object_unref (info);
}
/* This function mostly lifted from
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]