1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

FileChooser: Store strong reference to Native instance inside async callback

This commit is contained in:
reuk 2025-03-18 19:43:55 +00:00
parent cd981c1b1a
commit 9730cd2808
No known key found for this signature in database

View file

@ -107,6 +107,8 @@ public:
[intents addObject: fileAccessIntent];
}
auto strong = shared_from_this();
[fileCoordinator coordinateAccessWithIntents: intents queue: [NSOperationQueue mainQueue] byAccessor: ^(NSError* err)
{
if (err != nil)
@ -148,7 +150,7 @@ public:
result.add (std::move (juceUrl));
}
passResultsToInitiator (std::move (result));
strong->passResultsToInitiator (std::move (result));
}];
}