Skip to content

Commit 3c56099

Browse files
committed
Fix potential crash in Heavy exporter
1 parent 4f1aea4 commit 3c56099

1 file changed

Lines changed: 11 additions & 9 deletions

File tree

Source/Heavy/ExportingProgressView.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -585,17 +585,19 @@ class ExportingProgressView final : public Component
585585
{
586586
state = newState;
587587

588-
MessageManager::callAsync([this] {
589-
setVisible(state < NotExporting);
590-
continueButton.setVisible(state >= Success);
591-
if (state == Exporting || state == Flashing)
592-
console.clear();
593-
if (console.isShowing()) {
594-
console.grabKeyboardFocus();
588+
MessageManager::callAsync([_this = SafePointer(this)] {
589+
if (!_this)
590+
return;
591+
_this->setVisible(_this->state < NotExporting);
592+
_this->continueButton.setVisible(_this->state >= Success);
593+
if (_this->state == Exporting || _this->state == Flashing)
594+
_this->console.clear();
595+
if (_this->console.isShowing()) {
596+
_this->console.grabKeyboardFocus();
595597
}
596598

597-
resized();
598-
repaint();
599+
_this->resized();
600+
_this->repaint();
599601
});
600602
}
601603

0 commit comments

Comments
 (0)