]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/app.cpp
avoiding deprecated methods in wx code, avoiding for iphone builds
[wxWidgets.git] / src / osx / carbon / app.cpp
index b831bc2bc317c6cbb52c62ebc348661aa19610eb..22dfa62eddb3ca83ca48d6e7e68ec0b3b74e851d 100644 (file)
@@ -835,8 +835,8 @@ bool wxApp::Initialize(int& argc, wxChar **argv)
     event_posted_context.perform = macPostedEventCallback;
     m_macEventPosted = CFRunLoopSourceCreate(NULL,0,&event_posted_context);
     CFRunLoopAddSource(CFRunLoopGetCurrent(), m_macEventPosted, kCFRunLoopCommonModes);
-       // run loop takes ownership
-       CFRelease(m_macEventPosted);
+    // run loop takes ownership
+    CFRelease(m_macEventPosted);
         */
     return true;
 }
@@ -866,6 +866,20 @@ bool wxApp::ProcessIdle()
     return wxAppBase::ProcessIdle();
 }
 
+#if wxOSX_USE_COCOA_OR_CARBON
+
+int wxApp::OnRun()
+{
+    wxMacAutoreleasePool pool;
+    return wxAppBase::OnRun();
+}
+
+#else
+
+// iPhone version in utils.mm
+
+#endif
+
 #if wxOSX_USE_CARBON
 bool wxApp::DoInitGui()
 {
@@ -939,15 +953,16 @@ void wxApp::DoCleanUp()
 
 void wxApp::CleanUp()
 {
+    wxMacAutoreleasePool autoreleasepool;
 #if wxUSE_TOOLTIPS
     wxToolTip::RemoveToolTips() ;
 #endif
 
     if (m_macEventPosted)
-       {
-               CFRunLoopRemoveSource(CFRunLoopGetCurrent(), m_macEventPosted, kCFRunLoopCommonModes);
-               m_macEventPosted = NULL;
-       }
+    {
+        CFRunLoopRemoveSource(CFRunLoopGetCurrent(), m_macEventPosted, kCFRunLoopCommonModes);
+        m_macEventPosted = NULL;
+    }
 
     DoCleanUp();
 
@@ -1445,7 +1460,7 @@ void wxApp::MacCreateKeyEvent( wxKeyEvent& event, wxWindow* focus , long keymess
         // control interferes with some built-in keys like pgdown, return etc. therefore we remove the controlKey modifier
         // and look at the character after
 #ifdef __LP64__
-               // TODO new implementation using TextInputSources
+        // TODO new implementation using TextInputSources
 #else
         UInt32 state = 0;
         UInt32 keyInfo = KeyTranslate((Ptr)GetScriptManagerVariable(smKCHRCache), ( modifiers & (~(controlKey | shiftKey | optionKey))) | keycode, &state);