An Invalid Pointer exception is thrown by the memory manager when attempting to free invalid memory. This can happen in three ways.
The most common is that you are trying to free an object that you have already freed. If you enable FastMM FullDebugMode, it will detect this and immediately indicate a problem. (But be sure to create a map file so that it has the information needed to create useful stack traces.)
The second way is that you are trying to free memory that was allocated somewhere other than the memory manager. I saw this several times while passing a string from Delphi EXE to Delphi DLL that did not use the shared memory manager function.
And the third way involves messing with pointers directly and probably doesn't apply to you. If you try FreeMem or Dispose bad pointer that does not reference the actual block of memory allocated by FastMM, you will get this error.
Most likely the first. Use FullDebugMode and you can easily find the source of the problem.
Mason wheeler
source share