X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/56869c5423170499f9b816c7c2a5a43773e073c7..545cb3fcf2460919deb52cf47f6cb0bdf494fae7:/src/osx/core/timer.cpp?ds=sidebyside diff --git a/src/osx/core/timer.cpp b/src/osx/core/timer.cpp index 2a18cd7ff3..3f55f8895c 100644 --- a/src/osx/core/timer.cpp +++ b/src/osx/core/timer.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: sec/osx/core/timer.cpp +// Name: src/osx/core/timer.cpp // Purpose: wxTimer implementation using CoreFoundation // Author: Stefan Csomor // Modified by: @@ -88,8 +88,13 @@ bool wxOSXTimerImpl::Start( int milliseconds, bool mode ) wxASSERT_MSG( m_info->m_timerRef != NULL, wxT("unable to create timer")); - CFRunLoopAddTimer( CFRunLoopGetMain() // or CFRunLoopGetCurrent() ? - , m_info->m_timerRef, kCFRunLoopCommonModes) ; + CFRunLoopRef runLoop = 0; +#if wxOSX_USE_IPHONE + runLoop = CFRunLoopGetMain(); +#else + runLoop = CFRunLoopGetCurrent(); +#endif + CFRunLoopAddTimer( runLoop, m_info->m_timerRef, kCFRunLoopCommonModes) ; return true;