diff --git a/src/SFML/Window/OSX/AutoreleasePoolWrapper.mm b/src/SFML/Window/OSX/AutoreleasePoolWrapper.mm index 854f44ff..4a2a6cff 100644 --- a/src/SFML/Window/OSX/AutoreleasePoolWrapper.mm +++ b/src/SFML/Window/OSX/AutoreleasePoolWrapper.mm @@ -109,12 +109,12 @@ PoolWrapper::~PoolWrapper() #ifdef SFML_DEBUG if (count < 0) { sf::Err() << "~PoolWrapper : count is less than zero! " - "You called ReleasePool from a thread too many times." - << std::endl; + "You called ReleasePool from a thread too many times." + << std::endl; } else if (count > 0) { sf::Err() << "~PoolWrapper : count is greater than zero! " - "You called ReleasePool from a thread to few times." - << std::endl; + "You called ReleasePool from a thread to few times." + << std::endl; } else { // count == 0 sf::Err() << "~PoolWrapper is HAPPY!" << std::endl; } diff --git a/src/SFML/Window/OSX/HIDJoystickManager.cpp b/src/SFML/Window/OSX/HIDJoystickManager.cpp index aaab4842..fcb97309 100644 --- a/src/SFML/Window/OSX/HIDJoystickManager.cpp +++ b/src/SFML/Window/OSX/HIDJoystickManager.cpp @@ -29,6 +29,17 @@ #include #include +//////////////////////////////////////////////////////////// +// Private data +//////////////////////////////////////////////////////////// +namespace +{ + // Using a custom run loop mode solve some issues that appears when SFML + // is used with Cocoa. + CFStringRef const runLoopMode = CFSTR("SFML_RUN_LOOP_MODE"); +} + + namespace sf { namespace priv @@ -74,7 +85,7 @@ HIDJoystickManager::HIDJoystickManager() IOHIDManagerScheduleWithRunLoop(myHIDManager, CFRunLoopGetCurrent(), - kCFRunLoopDefaultMode); + runLoopMode); IOHIDManagerOpen(myHIDManager, kIOHIDOptionsTypeNone); } @@ -85,7 +96,7 @@ HIDJoystickManager::~HIDJoystickManager() { IOHIDManagerUnscheduleFromRunLoop(myHIDManager, CFRunLoopGetCurrent(), - kCFRunLoopDefaultMode); + runLoopMode); IOHIDManagerRegisterDeviceMatchingCallback(myHIDManager, NULL, 0); IOHIDManagerRegisterDeviceRemovalCallback(myHIDManager, NULL, 0); @@ -100,7 +111,7 @@ void HIDJoystickManager::Update() SInt32 status = kCFRunLoopRunHandledSource; while (status == kCFRunLoopRunHandledSource) { - status = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true); + status = CFRunLoopRunInMode(runLoopMode, 0, true); } }