Apply new patch fixing problem of IsRunning always returning True. See #11699

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63486 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2010-02-15 17:34:21 +00:00
parent ec073e73d1
commit b6ae7297d2
2 changed files with 4 additions and 13 deletions

View File

@@ -19,8 +19,7 @@
class WXDLLIMPEXP_BASE wxMSWTimerImpl : public wxTimerImpl class WXDLLIMPEXP_BASE wxMSWTimerImpl : public wxTimerImpl
{ {
public: public:
wxMSWTimerImpl(wxTimer *timer); wxMSWTimerImpl(wxTimer *timer) : wxTimerImpl(timer) { m_id = 0; };
virtual ~wxMSWTimerImpl();
virtual bool Start(int milliseconds = -1, bool oneShot = false); virtual bool Start(int milliseconds = -1, bool oneShot = false);
virtual void Stop(); virtual void Stop();

View File

@@ -118,22 +118,12 @@ IMPLEMENT_DYNAMIC_CLASS(wxTimerHiddenWindowModule, wxModule)
// wxMSWTimerImpl class // wxMSWTimerImpl class
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxMSWTimerImpl::wxMSWTimerImpl(wxTimer *timer)
:wxTimerImpl(timer)
{
m_id = GetNewTimerId(this);
}
wxMSWTimerImpl::~wxMSWTimerImpl()
{
TimerMap().erase(m_id);
}
bool wxMSWTimerImpl::Start(int milliseconds, bool oneShot) bool wxMSWTimerImpl::Start(int milliseconds, bool oneShot)
{ {
if ( !wxTimerImpl::Start(milliseconds, oneShot) ) if ( !wxTimerImpl::Start(milliseconds, oneShot) )
return false; return false;
m_id = GetNewTimerId(this);
// SetTimer() normally returns just idTimer but this might change in the // SetTimer() normally returns just idTimer but this might change in the
// future so use its return value to be safe // future so use its return value to be safe
UINT_PTR ret = ::SetTimer UINT_PTR ret = ::SetTimer
@@ -157,6 +147,8 @@ bool wxMSWTimerImpl::Start(int milliseconds, bool oneShot)
void wxMSWTimerImpl::Stop() void wxMSWTimerImpl::Stop()
{ {
::KillTimer(wxTimerHiddenWindowModule::GetHWND(), m_id); ::KillTimer(wxTimerHiddenWindowModule::GetHWND(), m_id);
TimerMap().erase(m_id);
m_id = 0;
} }
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------