mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Destroy the main window before exiting the application
This ensures all widgets inside the window get destroyed too. Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
7d9c1e9ee4
commit
0afe576a50
1 changed files with 3 additions and 1 deletions
|
@ -66,6 +66,7 @@ QString Translator::translate(const char *context, const char *sourceText,
|
||||||
}
|
}
|
||||||
|
|
||||||
static QApplication *application = NULL;
|
static QApplication *application = NULL;
|
||||||
|
static MainWindow *window = NULL;
|
||||||
|
|
||||||
int error_count;
|
int error_count;
|
||||||
const char *existing_filename;
|
const char *existing_filename;
|
||||||
|
@ -117,7 +118,7 @@ void init_ui(int *argcp, char ***argvp)
|
||||||
s.endGroup();
|
s.endGroup();
|
||||||
|
|
||||||
application->installTranslator(new Translator(application));
|
application->installTranslator(new Translator(application));
|
||||||
MainWindow *window = new MainWindow();
|
window = new MainWindow();
|
||||||
window->show();
|
window->show();
|
||||||
if (existing_filename && existing_filename[0] != '\0')
|
if (existing_filename && existing_filename[0] != '\0')
|
||||||
window->setTitle(MWTF_FILENAME);
|
window->setTitle(MWTF_FILENAME);
|
||||||
|
@ -134,6 +135,7 @@ void run_ui(void)
|
||||||
|
|
||||||
void exit_ui(void)
|
void exit_ui(void)
|
||||||
{
|
{
|
||||||
|
delete window;
|
||||||
delete application;
|
delete application;
|
||||||
if (existing_filename)
|
if (existing_filename)
|
||||||
free((void *)existing_filename);
|
free((void *)existing_filename);
|
||||||
|
|
Loading…
Add table
Reference in a new issue