PR# 19875 Memory leak in WEL
Problem Report Summary
Submitter: gobobe
Category: WEL
Priority: Medium
Date: 2023/01/30
Class: Bug
Severity: Serious
Number: 19875
Release: 22.12
Confidential: No
Status: Analyzed
Responsible:
Environment: win
Synopsis: Memory leak in WEL
Description
The following code: p: EV_PIXEL_BUFFER from until False loop p.destroy p.set_with_pointer (my_pointer) end will quickly run out of memory. This is due to a memory leak in WEL. I figured out that the problem was due to a missing call to `destroy_item` in WEL_GDIP_IMAGE.load_image_from_stream (like we have in `load_image_from_file_original`). You will find attached my modified version as well as an improvement to release external memory as soon as possible instead of waiting for the GC to call `dispose`.
To Reproduce
Problem Report Interactions
Thanks you for this report and contribution. We will check and test soon, and after a quick look at the difference, I think it is very likely to be integrated for next version.