mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
FileChooser: Fix double-delete of UTType instances
This commit is contained in:
parent
34f7d467c9
commit
4f474d97f4
1 changed files with 6 additions and 6 deletions
|
|
@ -192,18 +192,18 @@ private:
|
|||
|
||||
if ((flags & FileBrowserComponent::canSelectDirectories) != 0)
|
||||
{
|
||||
if (NSUniquePtr<UTType> 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<UTType> 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<UTType> 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()];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue