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

ModalCallbackFunction: Fix crash due to dangling reference

This commit is contained in:
ed 2021-07-22 15:42:50 +01:00
parent cf79cc4724
commit 3d4d0caca8

View file

@ -178,7 +178,7 @@ public:
explicit Callable (CallbackFn&& f) : fn (std::forward<CallbackFn> (f)) {}
void modalStateFinished (int result) override { fn (result); }
CallbackFn fn;
std::remove_reference_t<CallbackFn> fn;
};
return new Callable (std::forward<CallbackFn> (fn));