Opened 10 years ago
Closed 9 years ago
#250 closed defect (fixed)
QtSharp app doesn't always quit properly
Reported by: | ibboard | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | WarFoundry 0.1 |
Component: | WarFoundry-GUI-Qt# | Version: | Trunk |
Keywords: | quit | Cc: | |
Blocked By: | Blocking: |
Description
Sometimes, even though the QtSharp app is closed, it doesn't quit. This means that either debugging remains disabled until the "stop" button is pressed, or that the console remains associated with the app if it was run from the command-line.
Change History (7)
comment:1 Changed 10 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 10 years ago by
comment:3 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | confirmed → closed |
comment:4 Changed 10 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Re-open - last commit should have been against #260.
comment:5 Changed 9 years ago by
Seems to be a problem specific to something that has been done with the WarFoundry app. Creating a new app that just contains:
public static void Main(string[] args) { try { QApplication app = new QApplication(args, true); app.QuitOnLastWindowClosed = true; QApplication.Invoke(delegate{ QMainWindow win = new QMainWindow(); win.Show(); }); QApplication.Exec(); } catch(Exception ex) { QMessageBox.Critical(null, "Unhandled exception", ex.Message+"\n\nPlease see log for more details"); }
Terminates correctly without a problem.
comment:6 Changed 9 years ago by
Version: | Unknown or N/A → Trunk |
---|
Problem is caused by open and save dialogs, for some reason. If they're commented out then closing successfully terminates the app.
comment:7 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
(In r635) Fixes #250: QtSharp app doesn't always quit properly
- Override Close event to dispose of file dialogs (open and save)
- Remove unnecessary event handler hooked to close
- Change app initialisation to match pattern used by Synapse
- Create file dialogs without specifying "this" as parent - seems to be main fix, for some reason.
(In r493) Re #250:
QApplication.Exec() should quit anyway (after completion return a success/error code and Main loop should finish) but even using Environment.Exit() never completes