Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/code_examples/Tutorial_GUI_ParamEditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ Int main(int argc, const char** argv)

editor->store();
paramFile.store("Tutorial_ParamEditor_out.ini", param);

delete editor;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

But:
what happens if an exception is thrown between lines 54 and 60?

-->
better solution (since there is no need for the heap allocation in the first place):

  ParamEditor editor(nullptr);
  editor.load(param);
  editor.show();
  app.exec();

  editor.store();
  paramFile.store("Tutorial_ParamEditor_out.ini", param);

return 0;
} //end of main
2 changes: 1 addition & 1 deletion doc/code_examples/Tutorial_GUI_Plot1D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ Int main(int argc, const char ** argv)
Plot1DWidget * widget = new Plot1DWidget(Param(), nullptr);
widget->canvas()->addLayer(exp_sptr, on_disc_exp_sptr);
widget->show();

delete widget;
return app.exec();
} //end of main