mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
Android: Fix crash when deleting peer on touch event
This commit is contained in:
parent
84f29c5c5e
commit
f5dc5c3956
1 changed files with 6 additions and 0 deletions
|
|
@ -1762,6 +1762,8 @@ public:
|
||||||
if (touchesDown == 0)
|
if (touchesDown == 0)
|
||||||
ModifierKeys::currentModifiers = ModifierKeys::currentModifiers.withoutMouseButtons();
|
ModifierKeys::currentModifiers = ModifierKeys::currentModifiers.withoutMouseButtons();
|
||||||
|
|
||||||
|
WeakReference self { this };
|
||||||
|
|
||||||
handleMouseEvent (MouseInputSource::InputSourceType::touch,
|
handleMouseEvent (MouseInputSource::InputSourceType::touch,
|
||||||
pos,
|
pos,
|
||||||
ModifierKeys::currentModifiers.withoutMouseButtons(),
|
ModifierKeys::currentModifiers.withoutMouseButtons(),
|
||||||
|
|
@ -1771,6 +1773,9 @@ public:
|
||||||
{},
|
{},
|
||||||
index);
|
index);
|
||||||
|
|
||||||
|
if (self == nullptr)
|
||||||
|
return;
|
||||||
|
|
||||||
handleMouseEvent (MouseInputSource::InputSourceType::touch,
|
handleMouseEvent (MouseInputSource::InputSourceType::touch,
|
||||||
MouseInputSource::offscreenMousePos,
|
MouseInputSource::offscreenMousePos,
|
||||||
ModifierKeys::currentModifiers.withoutMouseButtons(),
|
ModifierKeys::currentModifiers.withoutMouseButtons(),
|
||||||
|
|
@ -2541,6 +2546,7 @@ private:
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AndroidComponentPeer)
|
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (AndroidComponentPeer)
|
||||||
|
JUCE_DECLARE_WEAK_REFERENCEABLE (AndroidComponentPeer)
|
||||||
};
|
};
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue