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 ibboard

Status: newconfirmed

comment:2 Changed 10 years ago by ibboard

(In r493) Re #250:

  • Add extra debugging code

QApplication.Exec() should quit anyway (after completion return a success/error code and Main loop should finish) but even using Environment.Exit() never completes

comment:3 Changed 10 years ago by ibboard

Resolution: fixed
Status: confirmedclosed

(In r541) Fixes #250: New panels don't work perfectly in Linux through Mono

  • Manually size the panel based on the contents

comment:4 Changed 10 years ago by ibboard

Resolution: fixed
Status: closedreopened

Re-open - last commit should have been against #260.

comment:5 Changed 9 years ago by ibboard

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 ibboard

Version: Unknown or N/ATrunk

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 ibboard

Resolution: fixed
Status: reopenedclosed

(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.
Note: See TracTickets for help on using tickets.