On Tue, 22 May 2012 00:53:35 -0700 (PDT) highpet wrote:
h> I look up wxWidgets Samples about usage of Class "wxSplashScreen". I found
h> it crashs when there is one more splashscreen frames.
I can't reproduce the problem under MSW with this patch to the sample:
diff --git a/samples/splash/splash.cpp b/samples/splash/splash.cpp
index 79014bd..856d34e 100644
--- a/samples/splash/splash.cpp
+++ b/samples/splash/splash.cpp
@@ -146,6 +146,10 @@ bool MyApp::OnInit()
wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,
6000, frame, wxID_ANY, wxDefaultPosition, wxDefaultSize,
wxSIMPLE_BORDER|wxSTAY_ON_TOP);
+ new wxSplashScreen(bitmap,
+ wxSPLASH_CENTRE_ON_SCREEN|wxSPLASH_TIMEOUT,
+ 6000, frame, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+ wxSIMPLE_BORDER|wxSTAY_ON_TOP);
}
#if !defined(__WXGTK20__)
Whether I click the splash screen or let it expire on its own, no crash
happens. What exactly do I need to do to provoke it? Also, under which
platform did you test? And what is the stack trace at the moment of the
crash?
h> AFAIK,wxSplashScreen destroy itself with code:
h>
h> =========wxWidgets-2.9.3\src\generic\splash.cpp line 103===
h> wxSplashScreen::~wxSplashScreen()
h> {
h> m_timer.Stop();
h>
h> wxEvtHandler::RemoveFilter(this);
h> }
Yes, this is correct.
h> The first splash use wxEvtHandler::RemoveFilter(this) remove all objects of
h> ms_filterList static linked list.
I don't understand why would this happen though. RemoveFilter(this)
removes just this object itself from the list of the filters, why do you
think that it removes all of them?
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/