Issue #12751: get rid of the direct exit() call in stable builds.

I pondered a lot about this one. In particular I wished we saw the leaks
earlier so that this change were in a RC (really unsure we'll have any
more RCs now).

On the one hand, I could tweak signal callbacks so that the callback
gui_exit_after_callback() is called before the fast exit(). But it feels
more and more like a hack over a hack.

Having 2 code paths depending on whether we are in a release or not is
ugly and would only hide bugs during the whole development cycle (as
proven here). Now when I read the comment, the part about speeding up
the quit process doesn't seem like it makes much sense these days (maybe
back then when this was implemented?). GIMP is fast to quit with or
without this.
Now the part where I worry is the problem of plug-in possibly still
running. Does it mean there used to be cases where GIMP would be stuck
at exit because of buggy plug-ins? I don't think I ever saw one of these
during the whole unstable cycle, and pretty sure we have code able to
kill plug-ins when needed. Even if not, by now, my preference would be
that, if ever someone were to report a similar case, we should just
improve our exiting code to kill (SIGKILL, without any chance of
avoiding it) any guitly plug-in.

This is why I finally decided to just get rid of this very old code.
For reference, the last time it was added was commit cdc2f0ded6 in
2004, though we can actually find older commits where it was removed
(921f00c13d), added (1db2ada311)… Looks like it used to be quite a
dance, but this is hopefully not needed anymore.
This commit is contained in:
Jehan 2025-02-21 20:57:03 +01:00
parent 614fdfcd70
commit b146b6255e

View file

@ -576,29 +576,8 @@ app_exit_after_callback (Gimp *gimp,
if (gimp->be_verbose)
g_print ("EXIT: %s\n", G_STRFUNC);
/*
* In releases, we simply call exit() here. This speeds up the
* process of quitting GIMP and also works around the problem that
* plug-ins might still be running.
*
* In unstable releases, we shut down GIMP properly in an attempt
* to catch possible problems in our finalizers.
*/
#ifdef GIMP_RELEASE
gimp_gegl_exit (gimp);
gegl_exit ();
exit (gimp_core_app_get_exit_status (GIMP_CORE_APP (app)));
#else
g_application_quit (G_APPLICATION (app));
#endif
return FALSE;
}