Re: [Gimp-developer] Python FU Scripting -- Memory Leak? or How to release python gimp objects properly to manage memory usage?

On 12-02-15 11:42 PM, Tom Vrankar wrote:
Here's the simple command sequence that demonstrates the "leak".
img =gp.gimp_image_new (1280, 720, 0)
dsp =gp.gimp_display_new (img)
lyr =gp.gimp_layer_new_from_drawable (src.layers[1], img)
img.insert_layer (lyr, position =0)
gp.gimp_display_delete (dsp)

I see memory use jump after each iteration. Any help is appreciated.

You are creating and destroying the display but you aren't doing the same with the image. You should call gimp_image_delete() after you call gimp_display_delete once you no longer need the image.


Kevin.           |"Nerds make the shiny things that distract
Owner of Elecraft K2 #2172      | the mouth-breathers, and that's why we're
                                | powerful!"
#include <disclaimer/favourite> |             --Chris Hardwick

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]