I have a piece of code looking like this :
TAxis *axis = 0; if (dynamic_cast(obj)) axis = (dynamic_cast
dynamic_cast will return 0 if the cast fails and you are casting to a pointer, which is your case. The problem is that you have either corrupted the heap earlier in your code, or rtti wasn't enabled.