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.
This commit is contained in:
Michael Natterer 2011-05-12 20:53:21 +02:00
parent 68a56a861e
commit 9e60dd547d
1 changed files with 4 additions and 0 deletions

View File

@ -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