GNOME Bugzilla – Bug 108966
gimp-drawable-get/set-pixel memory leaks
Last modified: 2003-03-26 11:24:54 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.
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...
Why don't you run gimp in valgrind and check if it is the core that leaks here ?
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.
*** This bug has been marked as a duplicate of 86586 ***