lmi
[Top][All Lists]
Advanced

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

Re[2]: [lmi] wxmsw-2.9.0 regression: messagebox doubling


From: Vadim Zeitlin
Subject: Re[2]: [lmi] wxmsw-2.9.0 regression: messagebox doubling
Date: Fri, 27 Feb 2009 13:58:08 +0100

On Fri, 27 Feb 2009 12:48:14 +0000 Greg Chicares <address@hidden> wrote:

GC> On 2009-02-26 19:06Z, Vadim Zeitlin wrote:
GC> > On Thu, 26 Feb 2009 16:40:59 +0000 Greg Chicares <address@hidden> wrote:
GC> > 
GC> > GC> At the risk of overstating the obvious...this:
GC> > GC>   http://lists.nongnu.org/archive/html/lmi/2009-02/msg00056.html
GC> > GC> would seem to be the worst of our remaining issues.
GC> > 
GC> >  This is the same problem which resulted in crash in my initial report,
GC> > i.e. the dangling view pointer wx doc-view code.
GC> 
GC> Might the cause be different?

 No, I'm pretty sure this is the cause of this particular crash (I prefer
to be precise in case there are any other ones lurking behind this one).

GC> Given this analysis:
GC> 
GC> http://lists.nongnu.org/archive/html/lmi/2009-02/msg00059.html
GC> | [...] then it crashes in wx code called from inside
GC> | safe_message_alert() because wxDocMDIChildFrame::m_childView is a dangling
GC> | pointer.
GC> 
GC> ...I tried the patch below [0], but I still observe this problem:
GC>   http://lists.nongnu.org/archive/html/lmi/2009-02/msg00056.html
GC> But with that patch, AFAICT, it is as though the function were
GC> written like this:
GC> 
GC> void safe_message_alert(char const* message)
GC> {
GC>     ::MessageBoxA(0, message, "Error", MB_OK | MB_ICONSTOP | MB_TASKMODAL);
GC> }
GC> 
GC> and there's no attempt to dereference any pointer in wx.

 There is: when a message box is shown, an activation event (WM_ACTIVATE)
is generated by Windows and sent to wxDocChildFrame which passes it over to
(already destroyed) m_childView.

GC> let me try the patchset in your 2009-02-27T12:32Z message

 This patch resets m_childView to NULL before executing the code which may
generate the activation event. It's still a bit ugly but unfortunately it
seems like the only way to make this work within the current framework
where everything keeps pointers to everything else.

 Regards,
VZ

reply via email to

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