Skip to content

Commit 6938fdc

Browse files
committed
canvas/main: Delete the initial window when closed
1 parent 4eb1861 commit 6938fdc

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Orange/canvas/__main__.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ def onrequest(url):
369369
QDir.addSearchPath("canvas_icons", os.path.join(dirpath, "icons"))
370370

371371
canvas_window = CanvasMainWindow()
372+
canvas_window.setAttribute(Qt.WA_DeleteOnClose)
372373
canvas_window.setWindowIcon(config.application_icon())
373374

374375
if stylesheet_string is not None:
@@ -450,8 +451,8 @@ def show_message(message):
450451
canvas_window.load_scheme(open_requests[-1].toLocalFile())
451452

452453
# local references prevent destruction
453-
_ = show_survey()
454-
__ = check_for_updates()
454+
survey = show_survey()
455+
update_check = check_for_updates()
455456

456457
# Tee stdout and stderr into Output dock
457458
log_view = canvas_window.log_view()
@@ -479,12 +480,14 @@ def show_message(message):
479480
status = app.exec_()
480481
except BaseException:
481482
log.error("Error in main event loop.", exc_info=True)
483+
status = 42
482484

483-
canvas_window.deleteLater()
484-
app.processEvents()
485-
app.flush()
486485
del canvas_window
486+
del survey
487+
del update_check
487488

489+
app.processEvents()
490+
app.flush()
488491
# Collect any cycles before deleting the QApplication instance
489492
gc.collect()
490493

0 commit comments

Comments
 (0)