From 938c3956bd0fffba695138563bb0276fde524347 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 14 May 2026 14:03:44 +0530 Subject: [PATCH] ... --- glfw/cocoa_window.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/glfw/cocoa_window.m b/glfw/cocoa_window.m index a0e4d285e..140a2ecb4 100644 --- a/glfw/cocoa_window.m +++ b/glfw/cocoa_window.m @@ -4362,7 +4362,7 @@ - (void)draggingSession:(NSDraggingSession *)session add_uri_list_drag_items(_GLFWwindow *window, NSMutableArray* dragItems, const char *uri_list, size_t uri_list_sz, bool use_promises, const GLFWimage *thumbnail) { NSString *input = [[[NSString alloc] initWithBytes:uri_list length:uri_list_sz encoding:NSUTF8StringEncoding] autorelease]; NSArray *lines = [input componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]]; - id dragItem; int count = 0; char buf[256]; + NSDraggingItem *dragItem; int count = 0; char buf[256]; for (NSString *rawLine in lines) { NSString *line = [rawLine stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; if (line.length == 0 || [line hasPrefix:@"#"]) continue; @@ -4378,7 +4378,7 @@ - (void)draggingSession:(NSDraggingSession *)session initWithFileType:type.identifier delegate:delegate] autorelease]; // Store the delegate in the provider's user info so it's retained provider.userInfo = delegate; - dragItem = provider; + dragItem = [[[NSDraggingItem alloc] initWithPasteboardWriter:provider] autorelease]; } else dragItem = [[[NSDraggingItem alloc] initWithPasteboardWriter:url] autorelease]; int err = add_drag_item(window, dragItems, dragItem, thumbnail); if (err) return err; @@ -4631,7 +4631,7 @@ - (instancetype)initWithWindow:(_GLFWwindow*)initWindow mimeType:(const char*)mi windowId = initWindow ? initWindow->id : 0; mimeType = _glfw_strdup(mime); instanceId = instance_id; - if (file_promise_providers == nil) file_promise_providers = [NSMutableArray array]; + if (file_promise_providers == nil) file_promise_providers = [[NSMutableArray alloc] init]; [file_promise_providers addObject:self]; } return self;