Open spinettaro opened 8 months ago
Ciao Andrea! Sorry for the late response :) What I'm experiencing is a Memory leak when I close the application. I'm testing the application with Win32 configuration. I can also create a simple project if you need it but here you can see the simple steps to reproduce it:
ReportMemoryLeaksOnShutdown := True;
aFormStand.NewAndShow<TForm2>
Expected Result:
Actual Result:
Let me know
oh sorry I missed a piece, I think that is the old code I committed for merge. I think the issue is that there is no check when the Form is created by TFormStand, then the lines you suggested should add a check if the form is owned by LInfo
:
{$IFDEF AUTOREFCOUNT}
LInfo.DisposeOf;
LInfo := nil;
{$ELSE}
if LInfo.FormIsOwned then LInfo.Form.Free;
LInfo.Free;
{$ENDIF}
or create a specific destructor for it
Once removed during the destructor the form needs to be freed