X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c2ca375c5620209d77a88d2d378bdcdedbc82e7e..c2c87924e7e3906b8cf1f93ebbd362eab17f6857:/src/unix/timerunx.cpp diff --git a/src/unix/timerunx.cpp b/src/unix/timerunx.cpp index 12dc0bdf27..9c7468ea53 100644 --- a/src/unix/timerunx.cpp +++ b/src/unix/timerunx.cpp @@ -18,6 +18,8 @@ #include "wx/wxprec.h" +#if wxUSE_TIMER + #ifndef WX_PRECOMP #include "wx/log.h" #include "wx/module.h" @@ -159,6 +161,11 @@ void wxTimerScheduler::NotifyExpired() wxUnixTimerImpl * const timer = s->m_timer; if ( timer->IsOneShot() ) { + // the timer needs to be stopped but don't call its Stop() from + // here as it would attempt to remove the timer from our list and + // we had already done it, so we just need to reset its state + timer->MarkStopped(); + // don't need it any more delete s; } @@ -249,3 +256,5 @@ wxUsecClock_t wxGetLocalTimeUsec() return wxGetLocalTimeMillis() * 1000L; } +#endif // wxUSE_TIMER +