Sane way to deallocate strings from DLL
My DLL specifically constructs strings for my MQL5 code (eg UTF16, null terminated, on the heap).
As far as I understood, metatrader will then automatically copy this string for the EA to use.
The problem now is that the specifically constructed string still lies somewhere in memory, causing a memory leak.
I can think of a few ways to free those strings again, but they all make the API of the DLL significantly more shitty. Is there any pattern to tackle this in a sane way?
My DLL specifically constructs strings for my MQL5 code (eg UTF16, null terminated, on the heap).
As far as I understood, metatrader will then automatically copy this string for the EA to use.
The problem now is that the specifically constructed string still lies somewhere in memory, causing a memory leak.
I can think of a few ways to free those strings again, but they all make the API of the DLL significantly more shitty. Is there any pattern to tackle this in a sane way?