Skip to content
Snippets Groups Projects
Commit 57a7528d authored by Martin Christoph Hierholzer's avatar Martin Christoph Hierholzer
Browse files

fix exceptions in constructor not shown properly

They were previously hidden by the "BUG found" message in
ApplicationBase due to the missing call to shutdown(). This is now being
called automatically in the Application destructor if the application
was not yet started fully, in which case this is ok to do there
(calling shutdown before destroying the Application data members is
important only if threads have been started already).
parent 1d7260d6
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,8 @@ namespace ChimeraTK {
* characters. Use only alphanumeric characters and underscores. */
explicit Application(const std::string& name);
~Application() override;
using ApplicationBase::getName;
/** This will remove the global pointer to the instance and allows creating
......
......@@ -46,6 +46,16 @@ Application::Application(const std::string& name) : ApplicationBase(name), Modul
/*********************************************************************************************************************/
Application::~Application() {
if(lifeCycleState == LifeCycleState::initialisation && !hasBeenShutdown) {
// likely an exception has been thrown in the initialisation phase, in which case we better call shutdown to prevent
// ApplicationBase from complaining and hiding the exception
ApplicationBase::shutdown();
}
}
/*********************************************************************************************************************/
void Application::enableTestableMode() {
assert(not initialiseCalled);
testableMode.enable();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment