Issue #12576: crash when applying filter from history after an edit.
This commit is contained in:
parent
f2cf2bfd04
commit
277d49235f
4 changed files with 32 additions and 15 deletions
|
|
@ -277,7 +277,17 @@ filters_run_procedure (Gimp *gimp,
|
|||
display);
|
||||
}
|
||||
|
||||
if (success)
|
||||
if (success &&
|
||||
(! GIMP_IS_GEGL_PROCEDURE (procedure) ||
|
||||
/* XXX GimpGeglProcedure made for filter-editing are
|
||||
* short-lived and should not be added to history. I'm not
|
||||
* sure it makes sense UX-wise anyway ("used" filters are for
|
||||
* first calls, not edits).
|
||||
* If ever we decide to change this UX logic, some code logic
|
||||
* changes are needed too. Cf. crash report #12576 and my
|
||||
* (Jehan's) technical comment in there..
|
||||
*/
|
||||
! gimp_gegl_procedure_is_editing_filter (GIMP_GEGL_PROCEDURE (procedure))))
|
||||
gimp_filter_history_add (gimp, procedure);
|
||||
|
||||
gimp_value_array_unref (args);
|
||||
|
|
|
|||
|
|
@ -458,7 +458,7 @@ gimp_gegl_procedure_execute_async (GimpProcedure *procedure,
|
|||
|
||||
GimpProcedure *
|
||||
gimp_gegl_procedure_new (Gimp *gimp,
|
||||
GimpDrawableFilter *filter,
|
||||
GimpDrawableFilter *filter_to_edit,
|
||||
GimpRunMode default_run_mode,
|
||||
GimpObject *default_settings,
|
||||
const gchar *operation,
|
||||
|
|
@ -484,7 +484,7 @@ gimp_gegl_procedure_new (Gimp *gimp,
|
|||
|
||||
gegl_procedure = GIMP_GEGL_PROCEDURE (procedure);
|
||||
|
||||
gegl_procedure->filter = filter;
|
||||
gegl_procedure->filter = filter_to_edit;
|
||||
gegl_procedure->operation = g_strdup (operation);
|
||||
gegl_procedure->default_run_mode = default_run_mode;
|
||||
gegl_procedure->menu_label = g_strdup (menu_label);
|
||||
|
|
@ -529,3 +529,11 @@ gimp_gegl_procedure_new (Gimp *gimp,
|
|||
|
||||
return procedure;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gimp_gegl_procedure_is_editing_filter (GimpGeglProcedure *procedure)
|
||||
{
|
||||
g_return_val_if_fail (GIMP_IS_GEGL_PROCEDURE (procedure), FALSE);
|
||||
|
||||
return (procedure->filter != NULL);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,15 +57,16 @@ struct _GimpGeglProcedureClass
|
|||
|
||||
GType gimp_gegl_procedure_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GimpProcedure * gimp_gegl_procedure_new (Gimp *gimp,
|
||||
GimpDrawableFilter *filter,
|
||||
GimpRunMode default_run_mode,
|
||||
GimpObject *default_settings,
|
||||
const gchar *operation,
|
||||
const gchar *name,
|
||||
const gchar *menu_label,
|
||||
const gchar *tooltip,
|
||||
const gchar *icon_name,
|
||||
const gchar *help_id);
|
||||
GimpProcedure * gimp_gegl_procedure_new (Gimp *gimp,
|
||||
GimpDrawableFilter *filter_to_edit,
|
||||
GimpRunMode default_run_mode,
|
||||
GimpObject *default_settings,
|
||||
const gchar *operation,
|
||||
const gchar *name,
|
||||
const gchar *menu_label,
|
||||
const gchar *tooltip,
|
||||
const gchar *icon_name,
|
||||
const gchar *help_id);
|
||||
gboolean gimp_gegl_procedure_is_editing_filter (GimpGeglProcedure *procedure);
|
||||
|
||||
#endif /* __GIMP_GEGL_PROCEDURE_H__ */
|
||||
|
|
|
|||
|
|
@ -2663,8 +2663,6 @@ gimp_item_tree_view_effects_edited_clicked (GtkWidget *widget,
|
|||
name,
|
||||
NULL, NULL, NULL);
|
||||
|
||||
gimp_filter_history_add (image->gimp, procedure);
|
||||
|
||||
variant = g_variant_new_uint64 (GPOINTER_TO_SIZE (procedure));
|
||||
g_variant_take_ref (variant);
|
||||
filters_run_procedure (image->gimp,
|
||||
|
|
|
|||
Loading…
Reference in a new issue