app: ref/unref the context in gimp_image_editor_set_context()

This commit is contained in:
Michael Natterer 2011-02-06 00:59:52 +01:00
parent 1931cca5ab
commit 11ac0296b9
1 changed files with 9 additions and 3 deletions

View File

@ -83,14 +83,20 @@ gimp_image_editor_set_context (GimpDocked *docked,
GimpImage *image = NULL; GimpImage *image = NULL;
if (editor->context) if (editor->context)
g_signal_handlers_disconnect_by_func (editor->context, {
gimp_image_editor_set_image, g_signal_handlers_disconnect_by_func (editor->context,
editor); gimp_image_editor_set_image,
editor);
g_object_unref (editor->context);
}
editor->context = context; editor->context = context;
if (context) if (context)
{ {
g_object_ref (editor->context);
g_signal_connect_swapped (context, "image-changed", g_signal_connect_swapped (context, "image-changed",
G_CALLBACK (gimp_image_editor_set_image), G_CALLBACK (gimp_image_editor_set_image),
editor); editor);