[PATCH] Destroy the main window before exiting the application

Dirk Hohndel dirk at hohndel.org
Wed Sep 18 10:03:56 UTC 2013


YES!

Thank you, Thiago.

Pushed.

/D

On Wed, 2013-09-18 at 12:32 -0300, Tomaz Canabrava wrote:
> ( this also fixes the 'columns not saving widths' ;p )
> 
> 
> 
> On Wed, Sep 18, 2013 at 12:27 PM, Thiago Macieira
> <thiago at macieira.org> wrote:
>         This ensures all widgets inside the window get destroyed too.
>         
>         Signed-off-by: Thiago Macieira <thiago at macieira.org>
>         ---
>          qt-gui.cpp | 4 +++-
>          1 file changed, 3 insertions(+), 1 deletion(-)
>         
>         diff --git a/qt-gui.cpp b/qt-gui.cpp
>         index 7414ad4..f76beed 100644
>         --- a/qt-gui.cpp
>         +++ b/qt-gui.cpp
>         @@ -66,6 +66,7 @@ QString Translator::translate(const char
>         *context, const char *sourceText,
>          }
>         
>          static QApplication *application = NULL;
>         +static MainWindow *window = NULL;
>         
>          int        error_count;
>          const char *existing_filename;
>         @@ -117,7 +118,7 @@ void init_ui(int *argcp, char ***argvp)
>                 s.endGroup();
>         
>                 application->installTranslator(new
>         Translator(application));
>         -       MainWindow *window = new MainWindow();
>         +       window = new MainWindow();
>                 window->show();
>                 if (existing_filename && existing_filename[0] != '\0')
>                         window->setTitle(MWTF_FILENAME);
>         @@ -134,6 +135,7 @@ void run_ui(void)
>         
>          void exit_ui(void)
>          {
>         +       delete window;
>                 delete application;
>                 if (existing_filename)
>                         free((void *)existing_filename);
>         --
>         1.7.11.7
>         
>         _______________________________________________
>         subsurface mailing list
>         subsurface at hohndel.org
>         http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
> 
> 
> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface




More information about the subsurface mailing list