diff --git a/src/SFML/Window/OSX/SFApplication.m b/src/SFML/Window/OSX/SFApplication.m index d12f26e36..289c8e8e9 100644 --- a/src/SFML/Window/OSX/SFApplication.m +++ b/src/SFML/Window/OSX/SFApplication.m @@ -58,29 +58,29 @@ NSMenu* mainMenu = [NSApp mainMenu]; if (mainMenu != nil) return; - mainMenu = [[NSMenu alloc] initWithTitle:@""]; + mainMenu = [[[NSMenu alloc] initWithTitle:@""] autorelease]; [NSApp setMainMenu:mainMenu]; // Application Menu (aka Apple Menu) NSMenuItem* appleItem = [mainMenu addItemWithTitle:@"" action:nil keyEquivalent:@""]; - NSMenu* appleMenu = [[SFApplication createAppleMenu] autorelease]; + NSMenu* appleMenu = [[SFApplication newAppleMenu] autorelease]; [appleItem setSubmenu:appleMenu]; // File Menu NSMenuItem* fileItem = [mainMenu addItemWithTitle:@"" action:nil keyEquivalent:@""]; - NSMenu* fileMenu = [[SFApplication createFileMenu] autorelease]; + NSMenu* fileMenu = [[SFApplication newFileMenu] autorelease]; [fileItem setSubmenu:fileMenu]; // Window menu NSMenuItem* windowItem = [mainMenu addItemWithTitle:@"" action:nil keyEquivalent:@""]; - NSMenu* windowMenu = [[SFApplication createWindowMenu] autorelease]; + NSMenu* windowMenu = [[SFApplication newWindowMenu] autorelease]; [windowItem setSubmenu:windowMenu]; [NSApp setWindowsMenu:windowMenu]; } //////////////////////////////////////////////////////// -+(NSMenu*)createAppleMenu ++(NSMenu*)newAppleMenu { // Apple menu is as follow: // @@ -159,7 +159,7 @@ //////////////////////////////////////////////////////// -+(NSMenu*)createFileMenu ++(NSMenu*)newFileMenu { // The File menu is as follow: // @@ -181,7 +181,7 @@ //////////////////////////////////////////////////////// -+(NSMenu*)createWindowMenu ++(NSMenu*)newWindowMenu { // The Window menu is as follow: // diff --git a/src/SFML/Window/OSX/SFWindowController.mm b/src/SFML/Window/OSX/SFWindowController.mm index 35c6c528f..e8ab7a44d 100644 --- a/src/SFML/Window/OSX/SFWindowController.mm +++ b/src/SFML/Window/OSX/SFWindowController.mm @@ -188,7 +188,7 @@ [m_window setIgnoresMouseEvents:NO]; // Create a master view containing our OpenGL view - NSView* masterView = [[SFBlackView alloc] initWithFrame:windowRect]; + NSView* masterView = [[[SFBlackView alloc] initWithFrame:windowRect] autorelease]; if (masterView == nil) { diff --git a/src/SFML/Window/OSX/WindowImplCocoa.mm b/src/SFML/Window/OSX/WindowImplCocoa.mm index 3502ecef7..bbe0ee153 100644 --- a/src/SFML/Window/OSX/WindowImplCocoa.mm +++ b/src/SFML/Window/OSX/WindowImplCocoa.mm @@ -216,7 +216,7 @@ void WindowImplCocoa::setUpProcess(void) // Register an application delegate if there is none if (![[SFApplication sharedApplication] delegate]) - [NSApp setDelegate:[[SFApplicationDelegate alloc] init]]; + [NSApp setDelegate:[[[SFApplicationDelegate alloc] init] autorelease]]; // Create menus for the application (before finishing launching!) [SFApplication setUpMenuBar];