Skip to content

libgimp and plugins/gfig: fix #9122, ownership problems for GimpResource

Lloyd Konneker requested to merge bootchk/gimp:gfigCrash into master

Three separate commits, all related to #9122 (closed).

The first two commits fix problems with GimpResource and GimpResourceSelectButton code. The last commit fixes problems in Gfig plugin's handling of the same.

The problems are memory management of GObjects (GimpResources were formerly just strings, now GObjects.)

These are problems that escaped notice when I and Jehan implemented GimpResource recently. You don't see the issue unless you call gimp_resource_select_button_set_resource and other methods repeatedly, which only Gfig does, apparently. So whatever testing I did when implementing GimpResource was not sufficient. Most plugin just use GimpResourceSelectButton in a very simple way, but Gfig does much more.

The changes to Gfig are to one file but extensive, but many are not actually related to the issue, instead comments and changes to the debug messaging. It took me a long time to find this bug, and I don't see the point in separating out the changes related to the issue, and the non-functional changes. If we are going to continue to support Gfig, it needs to be easy for someone to read and debug.

@Jehan or @cmyk.student, one of you please review and merge as I don't usually merge stuff not related to ScriptFu. And Jehan is most familiar with the GimpResource stuff.

Merge request reports