eclipse.platform.swt icon indicating copy to clipboard operation
eclipse.platform.swt copied to clipboard

[gtk] NativeImageLoader does not free all buffers resulting in off heap memory leak

Open NoahArno opened this issue 3 months ago • 3 comments

why not free buffer memory (OS.g_free(buffer[0])) when use NativeImageLoader.java#save method, GDKgdk_pixbuf_save_to_bufferv ?. It may be cause NativeMemory Leak

Image

NoahArno avatar Sep 22 '25 03:09 NoahArno

See buffer_ptr use. Please next time if you have a question, start new discussion under https://github.com/eclipse-platform/eclipse.platform.swt/discussions

iloveeclipse avatar Sep 22 '25 04:09 iloveeclipse

See buffer_ptr use. Please next time if you have a question, start new discussion under https://github.com/eclipse-platform/eclipse.platform.swt/discussions

Thanks, your screenshot fooled me. I see that buffer_ptr is related to the previous gdk_pixbuf_new_from_data call, amd buffer is also poorly named. Do you want to provide a PR with the fix?

iloveeclipse avatar Sep 22 '25 04:09 iloveeclipse

Thank you for your reply. I am happy to do this and will try to submit the PR after I finish work

NoahArno avatar Sep 22 '25 06:09 NoahArno