lmi
[Top][All Lists]
Advanced

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

Re[2]: [lmi] Unable to close lmi (resolved)


From: Vadim Zeitlin
Subject: Re[2]: [lmi] Unable to close lmi (resolved)
Date: Tue, 30 Dec 2008 18:46:34 +0100

On Tue, 30 Dec 2008 17:33:02 +0000 Greg Chicares <address@hidden> wrote:

GC> To clarify, there were two distinct problems:
GC> 
GC>   http://lists.nongnu.org/archive/html/lmi/2008-12/msg00016.html
GC>   "Suspected wx-2.8.9 regression"
GC> I do seek your insight there.

 Unfortunately I have hit some problems with MSVC build (as usual...) so I
still haven't rebuilt it. I'll try to do it before the end of the year (29
hours to go...).

GC> > GC> The ultimate cause is that IllustrationView::OnCreate(), an
GC> > GC> overridden virtual, can throw an exception (as in the situation
GC> > GC> above)--but it needs to return 'false' to prevent the doc-view
GC> > GC> framework from creating a zombie view.
GC> 
GC> and I'm sure that was my fault: I violated the contract of
GC> wxView::OnCreate() by failing to return 'false'. IOW, wx
GC> doesn't offer the "strong" exception-safety guarantee
GC>   http://www.boost.org/community/exception_safety.html
GC> and I shouldn't write code as though it did.

 Yes, wx definitely doesn't provide (almost) any exception-safety globally
but it would do no harm to make some code paths exception-safe.

GC> > I've just checked in the following change:
GC> > 
GC> >   http://trac.wxwidgets.org/changeset/57671
GC> > 
GC> > which could be backported (in a slightly modified form) to 2.8 branch if
GC> > you think this would be useful for LMI. Please let me know if you do.
GC> 
GC> I don't see any need to backport it, but thanks.
GC> 
GC> Actually, I'm not sure how that changeset could resolve the
GC> (former) problem in lmi, which was due to an exception that
GC> got caught far away. How could that be solved without writing
GC> try...catch?

 AFAIU the problem with throwing an exception from OnCreate() is that the
view continues to exist in an invalid ("zombie") state. This patch ensures
that the view is destroyed if OnCreate() fails and so I hoped would help
with this problem (besides plugging a memory leak).

 Was I wrong about this?
VZ

reply via email to

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