[Qt-interest] How to handle exceptions in Qt
Andreas Pakulat
apaku at gmx.de
Wed Dec 16 16:32:45 CET 2009
On 16.12.09 20:50:18, Santhosh Y wrote:
> Hi,
>
> In following snippet, I purposefully made a widget to NULL, and calling
> a function on that.
> It is crashing the moment it access a fn on that NULL pointer.
>
> But my expectation was that, control will reach catch(...) and then
> printing std::cout statement.
> But I am not seeing this message on my console.
Invalid Access to Memory cannot be caught with an exception (AFAIK). So
there's no way to catch such null-pointer-stuff, except a signal handler,
but from there you can just do a minimal dump of information and then error
out.
Andreas
--
You'll be sorry...
More information about the Qt-interest-old
mailing list