if a dialog constructor fails to return a GimpDockable, destroy the dock

2002-08-27  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpdialogfactory.c: if a dialog constructor fails
	to return a GimpDockable, destroy the dock we created for the
	dockable instead of leaking it. Cleanup.
This commit is contained in:
Michael Natterer 2002-08-27 14:53:15 +00:00 committed by Michael Natterer
parent d8088f9996
commit f5cb0cbd59
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2002-08-27 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdialogfactory.c: if a dialog constructor fails
to return a GimpDockable, destroy the dock we created for the
dockable instead of leaking it. Cleanup.
2002-08-27 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpitemfactory.c: g_strdup(entry->help_path) if

View File

@ -380,7 +380,7 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
if (! entry)
{
g_warning ("%s: no entry entry registered for \"%s\"",
g_warning ("%s: no entry registered for \"%s\"",
G_GNUC_FUNCTION, identifier);
return NULL;
}
@ -471,8 +471,10 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
G_GNUC_FUNCTION, identifier);
gtk_widget_destroy (dialog);
gtk_widget_destroy (dock);
dialog = NULL;
dock = NULL;
}
}
}
@ -809,7 +811,8 @@ gimp_dialog_factory_add_dialog (GimpDialogFactory *factory,
g_signal_connect_object (G_OBJECT (dialog), "destroy",
G_CALLBACK (gimp_dialog_factory_remove_dialog),
factory, G_CONNECT_SWAPPED);
factory,
G_CONNECT_SWAPPED);
}
void