diff options
-rw-r--r-- | qtmips_gui/coreview.cpp | 5 | ||||
-rw-r--r-- | qtmips_gui/mainwindow.cpp | 3 |
2 files changed, 3 insertions, 5 deletions
diff --git a/qtmips_gui/coreview.cpp b/qtmips_gui/coreview.cpp index 1750cc1..7210f1c 100644 --- a/qtmips_gui/coreview.cpp +++ b/qtmips_gui/coreview.cpp @@ -36,9 +36,4 @@ CoreViewScene::CoreViewScene(CoreView *view, machine::QtMipsMachine *machine) : alu->setPos(200, 100); pc_multiplexer->setPos(60, 100); pc_multiplexer->set(2); - - QGraphicsScene *old_scene = view->scene(); - view->setScene(this); - if (old_scene != nullptr) - delete old_scene; } 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 |