Browse Source

OnlineUnlockForm: Fix scope of AlertWindow so that it outlives the OverlayComp

v7.0.9
reuk 2 years ago
parent
commit
aec8617f59
No known key found for this signature in database GPG Key ID: FCB43929F012EE5C
2 changed files with 9 additions and 5 deletions
  1. +8
    -5
      modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp
  2. +1
    -0
      modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.h

+ 8
- 5
modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.cpp View File

@@ -102,15 +102,19 @@ struct OnlineUnlockForm::OverlayComp : public Component,
{
auto options = MessageBoxOptions::makeOptionsOk (MessageBoxIconType::WarningIcon,
TRANS ("Registration Failed"),
result.errorMessage);
messageBox = AlertWindow::showScopedAsync (options, nullptr);
result.errorMessage,
{},
&form);
form.messageBox = AlertWindow::showScopedAsync (options, nullptr);
}
else if (result.informativeMessage.isNotEmpty())
{
auto options = MessageBoxOptions::makeOptionsOk (MessageBoxIconType::InfoIcon,
TRANS ("Registration Complete!"),
result.informativeMessage);
messageBox = AlertWindow::showScopedAsync (options, nullptr);
result.informativeMessage,
{},
&form);
form.messageBox = AlertWindow::showScopedAsync (options, nullptr);
}
else if (result.urlToLaunch.isNotEmpty())
{
@@ -145,7 +149,6 @@ struct OnlineUnlockForm::OverlayComp : public Component,
Spinner spinner;
OnlineUnlockStatus::UnlockResult result;
String email, password;
ScopedMessageBox messageBox;
std::unique_ptr<TextButton> cancelButton;


+ 1
- 0
modules/juce_product_unlocking/marketplace/juce_OnlineUnlockForm.h View File

@@ -87,6 +87,7 @@ private:
struct OverlayComp;
friend struct OverlayComp;
ScopedMessageBox messageBox;
Component::SafePointer<Component> unlockingOverlay;
void buttonClicked (Button*) override;


Loading…
Cancel
Save