Hello,
I want to implement registration of memory leaks, and then checking arguments of internal_AddLeak() procedure if there is corresponding leak registered. I tried 2 approaches:
A) Storing leak registration inside
implementation
var leakArray : array of TLeakRegistration,
where TleakRegistration is a class
B) Storing leak registration in var leaks: TObjectDictionary<string, TLeakRegistration>
Problems:
When using A) approach, leakArray is already empty (length = 0) when internal_addLeak procedure is called.
When using B) approach, leaks collection is not empty, but it creates internal memory leak.