wxWidgets / wxWidgets

Cross-Platform C++ GUI Library
https://www.wxwidgets.org/
5.74k stars 1.69k forks source link

Doc/View and recursion problems #5456

Closed wxtrac closed 2 years ago

wxtrac commented 21 years ago

Issue migrated from trac ticket # 5456

priority: normal

2002-07-06 11:41:02: magr created the issue


Hi,

I experienced program crashes when moving from wxMSW 2.3.2 to 2.3.3 (CVS). I found that there was a problem with my wxView event handling. As I'm relaying some events to child windows in MyView::ProcessEvent (), there is a chance that events are processed twice due to the command event travelling feature (because the child window is somewhere in the chain of the wxDocMDIChildFrame), and I found that this can cause program crash if wxID_EXIT is handled twice.

At first I tried to fix the problem within my MyView::ProcessEvent(), but then I found it is much easier and cleaner to fix it in the wxDocMDIChildFrame() itself by blocking an event if it appears there for the second time.

As I found that understanding the effects of relaying events in the doc/view framework requires lots of code reading and analyis, I think with this patch most of the hard to get at issues are gone, and I can't think of side effects.

Regards Markus Greither

wxtrac commented 21 years ago

2002-07-06 11:41:02: magr uploaded file docmdi1.patch (0.9 KiB)

wxtrac commented 21 years ago

2002-07-19 22:14:09: @JulianSmart commented


Thanks -- applied and tested with the docvwmdi sample.

Julian