lmi
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi] Unable to close lmi (resolved)


From: Greg Chicares
Subject: [lmi] Unable to close lmi (resolved)
Date: Mon, 29 Dec 2008 05:27:38 +0000
User-agent: Thunderbird 2.0.0.18 (Windows/20081105)

[I believe I've solved this problem. It's documented here just
for the record.]

This message:
  http://lists.nongnu.org/archive/html/lmi/2008-12/msg00016.html
describes one way to reproduce a situation where an exception is
thrown in a class ultimately derived from wxView. That uncovers
a different problem, which subsequently arises when an attempt
is made to close the application: this messagebox
  Error
  Cannot dereference null pointer of type 'P8wxWindow'.
pops up during ViewEx::OnClose(), which throws an exception and
never returns--so the application cannot be closed at all by
normal means.

The proximate cause is that ViewEx::OnClose() is called when
wxView::GetFrame() is NULL, violating an implicit precondition.

The ultimate cause is that IllustrationView::OnCreate(), an
overridden virtual, can throw an exception (as in the situation
above)--but it needs to return 'false' to prevent the doc-view
framework from creating a zombie view.

I'll address the observed problem narrowly now, by trapping that
particular exception. A general solution could require a fairly
extensive rewrite, trapping all exceptions in potentially any
overridden wx function that doesn't return 'void'. That doesn't
seem urgent: I've seen this problem before, but I think it has
always arisen from an exception in IllustrationView::OnCreate().




reply via email to

[Prev in Thread] Current Thread [Next in Thread]