On Sun, 23 Sep 2018 14:33:26 +0200, Mike Wey wrote:

On 9/23/18 12:45 PM, huangyy wrote:

I want to processing lots of image (scale it). so, create a pixbuf object in every thread to processing image.

srcPixbuf = new Pixbuf(/path/to/image/file);

resize image and save. after processing some image, program report OutOfMemory error.

I think, maybe need to free pixbuf object everytime. But, the method of free pixbuf object was not found. How to free a pixbuf object ?

You can use the destroy function from druntime/object.

srcPixbuf.destroy();

https://dlang.org/phobos/object.html#.destroy

It's not work :( , same error report.