mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-23 01:44:22 +00:00
Deletion of ModalComponentManager::Callback objects passed to native dialog boxes.
This commit is contained in:
parent
ec524a437d
commit
f1c01f1f3c
4 changed files with 10 additions and 9 deletions
|
|
@ -665,7 +665,10 @@ JUCE_JNI_CALLBACK (JUCE_ANDROID_ACTIVITY_CLASSNAME, alertDismissed, void, (JNIEn
|
|||
jlong callbackAsLong, jint result))
|
||||
{
|
||||
if (ModalComponentManager::Callback* callback = (ModalComponentManager::Callback*) callbackAsLong)
|
||||
{
|
||||
callback->modalStateFinished (result);
|
||||
delete callback;
|
||||
}
|
||||
}
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -154,7 +154,7 @@ private:
|
|||
int result;
|
||||
JuceAlertBoxDelegate* delegate;
|
||||
UIAlertView* alert;
|
||||
ModalComponentManager::Callback* callback;
|
||||
ScopedPointer<ModalComponentManager::Callback> callback;
|
||||
const bool isYesNo, isAsync;
|
||||
|
||||
JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (iOSMessageBox)
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ public:
|
|||
private:
|
||||
AlertWindow::AlertIconType iconType;
|
||||
String title, message;
|
||||
ModalComponentManager::Callback* callback;
|
||||
ScopedPointer<ModalComponentManager::Callback> callback;
|
||||
const char* button1;
|
||||
const char* button2;
|
||||
const char* button3;
|
||||
|
|
|
|||
|
|
@ -2931,14 +2931,12 @@ class WindowsMessageBox : public AsyncUpdater
|
|||
{
|
||||
public:
|
||||
WindowsMessageBox (AlertWindow::AlertIconType iconType,
|
||||
const String& title_, const String& message_,
|
||||
Component* associatedComponent,
|
||||
UINT extraFlags,
|
||||
ModalComponentManager::Callback* callback_,
|
||||
const bool runAsync)
|
||||
const String& boxTitle, const String& m,
|
||||
Component* associatedComponent, UINT extraFlags,
|
||||
ModalComponentManager::Callback* cb, const bool runAsync)
|
||||
: flags (extraFlags | getMessageBoxFlags (iconType)),
|
||||
owner (getWindowForMessageBox (associatedComponent)),
|
||||
title (title_), message (message_), callback (callback_)
|
||||
title (boxTitle), message (m), callback (cb)
|
||||
{
|
||||
if (runAsync)
|
||||
triggerAsyncUpdate();
|
||||
|
|
@ -2964,7 +2962,7 @@ private:
|
|||
UINT flags;
|
||||
HWND owner;
|
||||
String title, message;
|
||||
ModalComponentManager::Callback* callback;
|
||||
ScopedPointer<ModalComponentManager::Callback> callback;
|
||||
|
||||
static UINT getMessageBoxFlags (AlertWindow::AlertIconType iconType) noexcept
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue