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: Closed
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
From:jfiat_es    Date:2023/03/29    Status: Closed    Download   
Thanks it was integrated at the end of January (see commit #106517).

From:jfiat_es    Date:2023/03/29    Status: Analyzed    Download   
Thanks it was integrated at the end of January (see commit #106517).

From:jfiat_es    Date:2023/01/31    Status: Analyzed    Download   
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.

From:gobobe    Date:2023/01/30    Status: Open    Download   
Class WEL_COM_ISTREAM

Attachment: wel_com_istream.e     Size:11518
From:gobobe    Date:2023/01/30    Status: Open    Download   
Class WEL_GDIP_IMAGE

Attachment: wel_gdip_image.e     Size:27259