diff --git a/src/gui_builder.cc b/src/gui_builder.cc index f0ed047..dee243c 100644 --- a/src/gui_builder.cc +++ b/src/gui_builder.cc @@ -448,10 +448,9 @@ GuiBuilder::GuiBuilder(const std::string& gladefile) // Main simulation widget ScrolledWindow* simulation_window = NULL; _refXml->get_widget("SimulationScrolledWindow", simulation_window); - _simulation_widget = new SimulationWidget(Simulation::get_instance()); - SimulationWidget* simulation_widget = manage(_simulation_widget); - simulation_window->add(*simulation_widget); - simulation_widget->show(); + _simulation_widget = manage(new SimulationWidget(Simulation::get_instance())); + simulation_window->add(*_simulation_widget); + _simulation_widget->show(); }