]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/utils.cpp
added wxTimerEvent::GetTimer()
[wxWidgets.git] / src / mac / carbon / utils.cpp
index f8f817d58c232b441bb1be25b2149abab1588b93..39597ec4eb347749c1af670749dfa3bb9def82c5 100644 (file)
@@ -57,6 +57,8 @@
     #include <TextCommon.h>
     #include <TextEncodingConverter.h>
 #endif
+
+#include "wx/mac/private/timer.h"
 #endif // wxUSE_GUI
 
 #include "wx/mac/private.h"
@@ -378,6 +380,11 @@ wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const
     return wxPORT_MAC;
 }
 
+wxTimerImpl* wxGUIAppTraits::CreateTimerImpl(wxTimer *timer)
+{
+    return new wxCarbonTimerImpl(timer);
+}
+
 int gs_wxBusyCursorCount = 0;
 extern wxCursor    gMacCurrentCursor;
 wxCursor        gMacStoredActiveCursor;
@@ -789,7 +796,10 @@ void wxMacControl::Dispose()
     wxASSERT_MSG( IsValidControlHandle(m_controlRef) , wxT("Invalid Control Handle (maybe already released) in Dispose") );
 
     // we cannot check the ref count here anymore, as autorelease objects might delete their refs later
-    CFRelease(m_controlRef);
+    // we can have situations when being embedded, where the control gets deleted behind our back, so only
+    // CFRelease if we are safe
+    if ( IsValidControlHandle(m_controlRef) )
+        CFRelease(m_controlRef);
     m_controlRef = NULL;
 }