plug-ins: fix #10787 Page Setup warning/critical

When closing the Page Setup dialog we had warnings and criticals in
the terminal.
The cause for this was that we were looking for the temp procedure
to notify the print plug-in. However, this temp procedure is only
installed if the print plug-in is running, not when running the
Page Setup directly, in which case it is not needed.

We now check if the procedure is valid (meaning the print plug-in is
running) before calling the temp notify procedure.
This commit is contained in:
Jacob Boerema 2024-04-18 12:42:30 -04:00
parent bcf30d6c2f
commit a367dec2f8

View file

@ -402,9 +402,13 @@ page_setup (GimpImage *image)
gimp_plug_in_set_pdb_error_handler (gimp_get_plug_in (),
GIMP_PDB_ERROR_HANDLER_PLUGIN);
/* Notify the Print plug-in if Page Setup was called from there */
procedure = gimp_pdb_lookup_procedure (gimp_get_pdb (), name);
return_vals = gimp_procedure_run (procedure, "image", image, NULL);
gimp_value_array_unref (return_vals);
if (procedure)
{
return_vals = gimp_procedure_run (procedure, "image", image, NULL);
gimp_value_array_unref (return_vals);
}
g_free (name);