EInvalidPointer = class(EHeapException);
class PASCALIMPLEMENTATION EInvalidPointer : public EHeapException
EInvalidPointer is the exception class for invalid pointer operations.
EInvalidPointer is raised when an application attempts an invalid pointer operation. For example, it can occur if an application tries to dispose of the same pointer twice, or refers to a pointer which has already been disposed of.
- Never raise an EInvalidPointer exception directly. EInvalidPointer is raised internally by the memory manager.
- If a pointer to unallocated memory is passed to Dispose or FreeMem, the behavior of the application largely depends on the target platform, as follows:
- For Windows platforms, an EInvalidPointer is raised in applications using System.SysUtils, and a run-time error is produced for applications that do not use System.SysUtils. (FastMM, the default memory manager, can detect an invalid pointer.)
- For Mac OS X and iOS platforms, Dispose and FreeMem do not raise an EInvalidPointer exception if an invalid pointer is passed to them.