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 108966 - gimp-drawable-get/set-pixel memory leaks
gimp-drawable-get/set-pixel memory leaks
Status: RESOLVED DUPLICATE of bug 86586
Product: GIMP
Classification: Other
Component: Script-Fu
1.x
Other All
: Normal normal
: ---
Assigned To: GIMP Bugs
Daniel Egger
Depends on:
Blocks:
 
 
Reported: 2003-03-22 19:14 UTC by Pedro Gimeno
Modified: 2003-03-26 11:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Pedro Gimeno 2003-03-22 19:14:36 UTC
Each call to either gmp-drawable-get-pixel or gmp-drawable-set-pixel leaks 
about 256 bytes of memory (with an RGB image).

How to reproduce:

Create an empty RGB 256x256 image and execute the following script:

(define (script-fu-memory-leak-bug img drawable)
  (let*
    ( (i 0)
      (pix (gimp-drawable-get-pixel drawable 50 50))
      (a1 (car pix))
      (a2 (cadr pix))
    )
    (while (< i 1024)
      (gimp-drawable-set-pixel drawable 50 50 a1 a2)
      (set! i (+ i 1))
    )
  )
)

The script-fu process will allocate (and never free) about 256K each time 
the script is invoked. Changing set-pixel to get-pixel (and removing a1 
and a2) produces the same result. Tested in 1.2.3 for Linux and 1.2.4-pre 
for Windows; the 256 byte estimation has only been checked with the 
Windows version.
Comment 1 Sven Neumann 2003-03-22 19:39:32 UTC
I'd say this is unrelated to gimp-drawable-get/set-pixel. It's simply
Script-Fu which is known to leak like hell, see bug #86586. But I'm
only guessing...
Comment 2 Sven Neumann 2003-03-25 09:59:59 UTC
Why don't you run gimp in valgrind and check if it is the core that
leaks here ?
Comment 3 Pedro Gimeno 2003-03-26 01:50:55 UTC
You're right; seems that this is a duplicate of bug #86586. For
example, using gimp-histogram in place of gimp-drawable-set-pixel also
causes leaks.
Comment 4 Sven Neumann 2003-03-26 11:24:54 UTC

*** This bug has been marked as a duplicate of 86586 ***