views:

112

answers:

2

Hi, it's my call stack window when i got "Invalid Pointer Operation" Error :

CalStack

What is the reason for this error?

Thank you

+6  A: 

You've attempted to release memory that the memory manager doesn't recognize as belonging to it.

The exception comes from an object's destructor, which indicates that you're attempting to free an object that has already been freed. Otherwise, you're calling Free on an variable that never had a valid object reference in the first place; heed compiler warnings about uninitialized variables.

Rob Kennedy
Thanks for response . but i don't know which object has already been freed !! . how can i find it ?
Kermia
Well, the exception occurs from a menu item's Click method, which is probably calling an OnClick handler that you've written. Start there.
Rob Kennedy
If you already have it in the debugger, you can start at the top of the stack trace and double-click each line. You can follow it backwards to see what the calls were. You should look into using FastMM. It is excellent for tracking down memory management problems.
Mike
+3  A: 

Please, see item "FastMM" in this article. Though it says about memory leaks, it is really an introduction to debugging memory managers, which are used to find problems with dynamic memory - just like your case.

Alexander