1
0
Fork 0
mirror of https://github.com/gwm17/glfw.git synced 2024-11-23 02:38:52 -05:00

Cocoa: Fix duplicate conversion of title string

(cherry picked from commit a875a536b7)
This commit is contained in:
Camilla Löwy 2019-12-10 13:47:19 +01:00 committed by Camilla Löwy
parent 2b1e2d2e49
commit 8c3d2f769f

View File

@ -967,10 +967,11 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window)
void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char *title) void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char *title)
{ {
@autoreleasepool { @autoreleasepool {
[window->ns.object setTitle:@(title)]; NSString* string = @(title);
[window->ns.object setTitle:string];
// HACK: Set the miniwindow title explicitly as setTitle: doesn't update it // HACK: Set the miniwindow title explicitly as setTitle: doesn't update it
// if the window lacks NSWindowStyleMaskTitled // if the window lacks NSWindowStyleMaskTitled
[window->ns.object setMiniwindowTitle:@(title)]; [window->ns.object setMiniwindowTitle:string];
} // autoreleasepool } // autoreleasepool
} }