Einzelnen Beitrag anzeigen

TurboMagic

Registriert seit: 28. Feb 2016
Ort: Nordost Baden-Württemberg
2.936 Beiträge
 
Delphi 12 Athens
 
#17

AW: Delphi 12: Fehler mit Action := caFree

  Alt 3. Dez 2023, 15:23
This Visual manager thing was appearendly introduced to implement this support, but they introduced a bug in the process as well.
At the very end of TCustomForm.WndProc there are these lines:

Delphi-Quellcode:
  inherited WndProc(Message);

  if VisualManager_AcceptMessage(Message) then
    VisualManager_WndProc(Message);
end;
Closing a secondary form with an OnClose handler that sets caFree as close action eventually calls TCustomform.Release, which posts a CM_RELEASE message to the form. The inherited WndProc call above passes that to the CMRelease message handler, which Frees the form instance. So the form self reference is invalid when VisualManager_AcceptMessage is called, and since that method tries to read a field of the form it blows up.
Thanks for this thorough analysis!
Did you already check if that bug is already known? Means a QP report for it exists?
If none exists yet, would you be so kind to file one?

Ok, I just saw your last post in german on tis matter where you ask the OP to create a QP report if none exists yet.
So please disregard this one. The OP should use your material though, as this looks like a quite good starting point
for fixing it.

Geändert von TurboMagic ( 3. Dez 2023 um 15:26 Uhr)
  Mit Zitat antworten Zitat