wxTimer::Start() now calls Stop()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8347 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-09-13 09:04:48 +00:00
parent 33ebcd800c
commit 99646f7ee4
3 changed files with 27 additions and 12 deletions

View File

@@ -115,6 +115,26 @@ void wxTimerBase::Notify()
(void)m_owner->ProcessEvent(event);
}
bool wxTimerBase::Start(int milliseconds, bool oneShot)
{
if ( IsRunning() )
{
// not stopping the already running timer might work for some
// platforms (no problems under MSW) but leads to mysterious crashes
// on the others (GTK), so to be on the safe side do it here
Stop();
}
if ( milliseconds != -1 )
{
m_milli = milliseconds;
}
m_oneShot = oneShot;
return TRUE;
}
#endif // wxUSE_GUI
// ----------------------------------------------------------------------------