Einzelnen Beitrag anzeigen

Kas Ob.

Registriert seit: 3. Sep 2023
214 Beiträge
 
#8

AW: Unerklärliche Access Violation

  Alt 7. Sep 2023, 17:00
[QUOTE=peterbelow;1526592]
Das ist ziemlich eindeutig. Ein "read of address xxx" mit einer sehr niedrigen Adresse ist praktisch immer die Folge eines Fehlers im Kode, wobei eine Methode oder Property eines Objektes über eine Variable aufgerufen wird, die Nil ist anstatt eine valide Objektreferenz zu enthalten.

Ein beliebter Fehler ist hier der falsche Aufruf eines Constructors, d.h.

Delphi-Quellcode:
var
  aObj: TSomeClass;
begin
  aObj.Create;
  aObj.DoSomething; // Boom!
You are right here, just to point one thing the use of the above function will fail always, the OP said it fails sometimes, so this is not the exact case, also the above will have low access address (closer to 0) only when the stack was clean (zero filled).
My take here, this is a use-after-free case, and likely it was freed using FreeAndNil.
  Mit Zitat antworten Zitat