Commit 9f0f11f4 authored by Ell's avatar Ell

app: fix potential segfault in gimp_action_history_activate_callback()

In gimp_action_history_activate_callback(), bail if history.gimp is
NULL, instead of dereferencing it.  This can happen if GIMP is shut
down during the execution of a temporary procedure, such as a
script-fu script.  See the code comment for details.

(cherry picked from commit 6544ce43)
parent 32457071
......@@ -355,11 +355,25 @@ void
gimp_action_history_activate_callback (GtkAction *action,
gpointer user_data)
{
GimpGuiConfig *config = GIMP_GUI_CONFIG (history.gimp->config);
GimpGuiConfig *config;
const gchar *action_name;
GList *link;
GimpActionHistoryItem *item;
/* we can get here after gimp_action_history_exit() has been called, if
* gimp_exit() was called during the execution of a temporary procedure,
* which was executed in response to a GimpProcedureAction, such as a script-
* fu script (temporary procedures run a nested mainloop, during which
* anything can happen.) the GimpProcedureAction's "selected" signal, in
* response to which the procedure is run, is emitted before any user-
* provided "activate" handlers are invoked, and so this function will be
* called *after* the procedure returns.
*/
if (! history.gimp)
return;
config = GIMP_GUI_CONFIG (history.gimp->config);
if (config->action_history_size == 0)
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment