]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/utils.cpp
Oops, file wasn't saved before last commit
[wxWidgets.git] / src / mac / carbon / utils.cpp
index 54913b5d00a4fbd94aa1d426600e49eb4e3ec0da..3824110a77b07fca411faeb289d36b19204e9386 100644 (file)
 #endif
 #endif
 
-// ---------------------------------------------------------------------------
-// code used in both base and GUI compilation
-// ---------------------------------------------------------------------------
+#if wxUSE_BASE
 
 // our OS version is the same in non GUI and GUI cases
-wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin)
+wxOperatingSystemId wxGetOsVersion(int *majorVsn, int *minorVsn)
 {
     long theSystem;
-
-    // are there x-platform conventions ?
-
     Gestalt(gestaltSystemVersion, &theSystem);
-    if (minorVsn != NULL)
-        *minorVsn = (theSystem & 0xFF);
 
-    if (majorVsn != NULL)
+    if ( majorVsn != NULL )
         *majorVsn = (theSystem >> 8);
 
+    if ( minorVsn != NULL )
+        *minorVsn = (theSystem & 0xFF);
+
 #if defined( __DARWIN__ )
     return wxOS_MAC_OSX_DARWIN;
 #else
@@ -92,10 +88,6 @@ wxOperatingSystemId wxGetOsVersion(int *verMaj, int *verMin)
 #endif
 }
 
-
-
-#if wxUSE_BASE
-
 // ----------------------------------------------------------------------------
 // debugging support
 // ----------------------------------------------------------------------------
@@ -834,6 +826,11 @@ void wxMacControl::Init()
 
 void wxMacControl::Dispose()
 {
+    wxASSERT_MSG( IsValidControlHandle(m_controlRef) , wxT("Invalid Control Handle (maybe already released) in Dispose") );
+
+    CFIndex count = CFGetRetainCount( m_controlRef ) ;
+    wxASSERT_MSG( count == 1 , wxT("Reference Count of native control was not 1 in Dispose") );
+
     ::DisposeControl( m_controlRef );
     m_controlRef = NULL;
 }