Commit cc2c8f94 authored by Chris Rizzitello's avatar Chris Rizzitello

Fix Crash on Tab Close

Summary: Fix crash on Tab Close

Reviewers: laysrodrigues, tcanabrava, patrickelectric

Reviewed By: laysrodrigues, patrickelectric

Subscribers: #atelier_general_development

Tags: #atelier_general_development

Differential Revision: https://phabricator.kde.org/D23455
parents 82563e17 a31c1400
......@@ -46,15 +46,14 @@ MainWindow::MainWindow(QWidget *parent) :
connect(m_instances, &QTabWidget::tabCloseRequested, this, [this](int index) {
auto tempWidget = qobject_cast<AtCoreInstanceWidget *>(m_instances->widget(index));
if (tempWidget->isPrinting()) {
if (askToClose()) {
delete tempWidget;
} else {
return;
}
} else {
delete tempWidget;
if (tempWidget->isPrinting() && !askToClose()) {
return;
}
tempWidget->disconnect();
tempWidget->close();
m_instances->removeTab(index);
if (m_instances->count() == 1) {
m_instances->setTabsClosable(false);
m_instances->setMovable(false);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment