After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 159051 - Make gimp_displays_reconnect() take over the new image's initial refcount
Make gimp_displays_reconnect() take over the new image's initial refcount
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: General
git master
Other All
: High normal
: 2.2
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2004-11-22 12:04 UTC by Michael Natterer
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Michael Natterer 2004-11-22 12:04:03 UTC
As discussed on gimp-developer, there is a problem with
gimp_displays_reconnect() which causes the new image
to be leaked. To properly fix this, IMHO the following
changes need to be done:

(1) work as documented (fail if the new image already has a display).
(2) also fail if the old image has no display.
(3) make it take over the reference count on success.
Comment 1 Sven Neumann 2004-11-22 12:24:24 UTC
Uh? I think the conclusion on the list was that the script was broken and the
GIMP behaviour entirely correct. At least that's what my experiments with the
Script-Fu console showed.
Comment 2 Michael Natterer 2004-11-22 12:38:57 UTC
The current implementation makes it impossible to get rid
of the new image, because gimp_image_delete() does not
work on images which have a display.

The PDB API should not have to bother with reference counts
and the general rule is that once there is s display for
an image, there is no way of deleting it via the PDB.
Comment 3 Sven Neumann 2004-11-22 21:02:24 UTC
Well, it needs to be fixed then.
Comment 4 Michael Natterer 2004-11-29 17:01:16 UTC
Fixed in CVS:

2004-11-29  Michael Natterer  <mitch@gimp.org>

	* tools/pdbgen/pdb/display.pdb: make it work as documented (fail
	if the new_image already has a display). Also fail if the
	old_image doesn't have any display (changed docs accordingly).
	On success, take over the initial reference count of the new
	image, just as the gimp_display_new() PDB wrapper does.
	Fixes bug #159051.

	* app/pdb/display_cmds.c
	* libgimp/gimpdisplay_pdb.c: regenerated.