Delphi / Object Pascal · Exception
What does Runtime Error 216: EAccessViolation mean in Delphi / Object Pascal?
The program tried to read or write memory it does not have valid access to, commonly by dereferencing a nil pointer or an object reference that was already freed. This is the single most reported Delphi runtime error, and the one developers mean when they just say access violation.
The program tried to read or write memory it does not have valid access to, commonly by dereferencing a nil pointer or an object reference that was already freed. This is the single most reported Delphi runtime error, and the one developers mean when they just say access violation.
Turn on Tools, Debugger Options, Language Exceptions, Stop on Delphi Exceptions so the debugger breaks exactly where the violation happens rather than reporting only a raw memory address after the fact. A common but non-obvious cause is calling Application.ProcessMessages from inside an event handler, which lets the same event fire again before the first call finishes and corrupts state the second call is still using.