From 4f474d97f49b2fe8cd605b0e88e3a079673f6a9d Mon Sep 17 00:00:00 2001 From: reuk Date: Thu, 12 Dec 2024 12:58:54 +0000 Subject: [PATCH] FileChooser: Fix double-delete of UTType instances --- .../juce_gui_basics/native/juce_FileChooser_ios.mm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/juce_gui_basics/native/juce_FileChooser_ios.mm b/modules/juce_gui_basics/native/juce_FileChooser_ios.mm index b4d038e551..5fa0d1bd3b 100644 --- a/modules/juce_gui_basics/native/juce_FileChooser_ios.mm +++ b/modules/juce_gui_basics/native/juce_FileChooser_ios.mm @@ -192,18 +192,18 @@ private: if ((flags & FileBrowserComponent::canSelectDirectories) != 0) { - if (NSUniquePtr ptr {[UTType typeWithIdentifier: @"public.folder"]}) - [types.get() addObject: ptr.get()]; + if (auto* ptr = [UTType typeWithIdentifier: @"public.folder"]) + [types.get() addObject: ptr]; } else { if (validExtensions.isEmpty()) - if (NSUniquePtr ptr {[UTType typeWithIdentifier: @"public.data"]}) - [types.get() addObject: ptr.get()]; + if (auto* ptr = [UTType typeWithIdentifier: @"public.data"]) + [types.get() addObject: ptr]; for (const auto& extension : validExtensions) - if (NSUniquePtr ptr {[UTType typeWithFilenameExtension: juceStringToNS (extension)]}) - [types.get() addObject: ptr.get()]; + if (auto* ptr = [UTType typeWithFilenameExtension: juceStringToNS (extension)]) + [types.get() addObject: ptr]; } return [[FileChooserControllerClass alloc] initForOpeningContentTypes: types.get()];