]> git.lyx.org Git - lyx.git/blobdiff - src/lyx_main.C
ensure that Application is properly destroyed after at the end of LyX::priv_exec()
[lyx.git] / src / lyx_main.C
index 9da0098cbf0102f35afe3cfc1037eb4126dc5381..f1eb44260610411e3c0ffa3378c882c42cc751e5 100644 (file)
@@ -264,7 +264,12 @@ int LyX::priv_exec(int & argc, char * argv[])
                theApp = 0;
        }
 
-       return exec2(argc, argv);
+       int exit_status = exec2(argc, argv);
+
+       if (lyx::use_gui)
+               application_.reset();
+
+       return exit_status;
 }