Bug 686850 - Help system: GIMP crashes and closes without saving changes

When gimp_plug_in_close()ing a plug-in (such as when cancel is
clicked), make sure we don't leak the proc_frames of all temporary
procedures the plug-in is currently running. By properly disposing the
GimpPlugInProcFrame, the progress window and its cancel button in
above bug get destroed on first click, and the user has no chance of
trying to kill an already finalized plug-in again.
This commit is contained in:
Michael Natterer 2012-11-05 01:12:21 +01:00
parent ec95a73322
commit eac70cc513
1 changed files with 8 additions and 4 deletions

View File

@ -420,8 +420,6 @@ void
gimp_plug_in_close (GimpPlugIn *plug_in,
gboolean kill_it)
{
GList *list;
g_return_if_fail (GIMP_IS_PLUG_IN (plug_in));
g_return_if_fail (plug_in->open);
@ -533,9 +531,9 @@ gimp_plug_in_close (GimpPlugIn *plug_in,
gimp_wire_clear_error ();
for (list = plug_in->temp_proc_frames; list; list = g_list_next (list))
while (plug_in->temp_proc_frames)
{
GimpPlugInProcFrame *proc_frame = list->data;
GimpPlugInProcFrame *proc_frame = plug_in->temp_proc_frames->data;
#ifdef GIMP_UNSTABLE
g_printerr ("plug-in '%s' aborted before sending its "
@ -548,6 +546,12 @@ gimp_plug_in_close (GimpPlugIn *plug_in,
{
g_main_loop_quit (proc_frame->main_loop);
}
/* pop the frame here, because normally this only happens in
* gimp_plug_in_handle_temp_proc_return(), which can't
* be called after plug_in_close()
*/
gimp_plug_in_proc_frame_pop (plug_in);
}
if (plug_in->main_proc_frame.main_loop &&