gui.cpp

changeset 146
2ab24976acaa
parent 145
ddf24c380be6
child 147
291a1fe2d278
--- a/gui.cpp	Sat Apr 27 16:22:35 2013 +0300
+++ b/gui.cpp	Sun Apr 28 04:04:36 2013 +0300
@@ -22,6 +22,7 @@
 #include <qmenubar.h>
 #include <qstatusbar.h>
 #include <qsplitter.h>
+#include <qcoreapplication.h>
 #include "common.h"
 #include "gldraw.h"
 #include "gui.h"
@@ -143,6 +144,14 @@
 	setTitle ();
 	setMinimumSize (320, 200);
 	resize (800, 600);
+	
+	connect (QCoreApplication::instance (), SIGNAL (aboutToQuit ()), this, SLOT (slot_lastSecondCleanup ()));
+}
+
+// =============================================================================
+void ForgeWindow::slot_lastSecondCleanup () {
+	R->setParent (null);
+	delete R;
 }
 
 // =============================================================================
@@ -200,6 +209,7 @@
 	qViewMenu->addAction (ACTION (resetView));			// Reset View
 	qViewMenu->addSeparator ();							// -----
 	qViewMenu->addAction (ACTION (screencap));			// Screencap Part
+	qViewMenu->addAction (ACTION (showHistory));			// Edit History
 	
 	// Insert menu
 	qInsertMenu = menuBar ()->addMenu (tr ("&Insert"));
@@ -261,10 +271,6 @@
 	qMoveMenu->addAction (ACTION (rotateZPos));			// Rotate +Z
 	qMoveMenu->addAction (ACTION (rotateZNeg));			// Rotate -Z
 	
-	// Control menu
-	qControlMenu = menuBar ()->addMenu (tr ("&Control"));
-	qControlMenu->addAction (ACTION (showHistory));		// Show History
-	
 #ifndef RELEASE
 	// Debug menu
 	qDebugMenu = menuBar ()->addMenu (tr ("&Debug"));

mercurial