class WXDLLIMPEXP_BASE wxMSWTimerImpl : public wxTimerImpl
{
public:
- wxMSWTimerImpl(wxTimer *timer);
- virtual ~wxMSWTimerImpl();
+ wxMSWTimerImpl(wxTimer *timer) : wxTimerImpl(timer) { m_id = 0; };
virtual bool Start(int milliseconds = -1, bool oneShot = false);
virtual void Stop();
// 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)
{
if ( !wxTimerImpl::Start(milliseconds, oneShot) )
return false;
+ m_id = GetNewTimerId(this);
// SetTimer() normally returns just idTimer but this might change in the
// future so use its return value to be safe
UINT_PTR ret = ::SetTimer
void wxMSWTimerImpl::Stop()
{
::KillTimer(wxTimerHiddenWindowModule::GetHWND(), m_id);
+ TimerMap().erase(m_id);
+ m_id = 0;
}
// ----------------------------------------------------------------------------