Is there any way to catch or detect access violation error?
should throw error, but it doesn't.
Posts 2 | Views 2187
Error handling (try catch)
The access violation error isn't thrown (exceptions are thrown not errors) - it occurs when you access memory that you don't own.
Anyway you can initialize your pointers with 0 (null pointer) and then first check for 0 and only then call a member-function (to be a little more safer you can assign 0 to the pointer after you delete it then you detect the attempt to call function after the pointer is deleted)
http://qt-project.org/groups/qt_romaniaposted Reputation: 40 | Posts: 379