aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/mainwindow.cpp
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2018-01-05 17:34:25 +0100
committerKarel Kočí <cynerd@email.cz>2018-01-05 17:34:25 +0100
commit11d6ad2a4574e55e6d9aed43d452dcef822a9247 (patch)
tree5c94370e50bf2c4038d0016ea113cf1b85de7913 /qtmips_gui/mainwindow.cpp
parent8025ccc2091228f9d089532852a2380f5f5a80b1 (diff)
downloadqtmips-11d6ad2a4574e55e6d9aed43d452dcef822a9247.tar.gz
qtmips-11d6ad2a4574e55e6d9aed43d452dcef822a9247.tar.bz2
qtmips-11d6ad2a4574e55e6d9aed43d452dcef822a9247.zip
Remove old scene in more appropriate place
Previous implementation was pretty confusing. There was no delete on level where variable override was happening. The object removal was implemented inside constructor. Very nasty.
Diffstat (limited to 'qtmips_gui/mainwindow.cpp')
-rw-r--r--qtmips_gui/mainwindow.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp
index a286f0d..65e6469 100644
--- a/qtmips_gui/mainwindow.cpp
+++ b/qtmips_gui/mainwindow.cpp
@@ -81,7 +81,10 @@ void MainWindow::create_core(machine::MachineConfig *config) {
// Create machine
machine = new machine::QtMipsMachine(config);
// Create machine view
+ if (corescene != nullptr)
+ delete corescene;
corescene = new CoreViewScene(coreview, machine);
+ coreview->setScene(corescene);
set_speed(); // Update machine speed to current settings