Shutdown Bloom, if configured to do so, upon receiving the DebugSessionFinished event

This commit is contained in:
Nav
2022-02-09 17:50:32 +00:00
parent 8d0dc68da0
commit 08f4ee30b2
2 changed files with 17 additions and 0 deletions

View File

@@ -114,6 +114,10 @@ namespace Bloom
std::bind(&Application::onDebugServerThreadStateChanged, this, std::placeholders::_1) std::bind(&Application::onDebugServerThreadStateChanged, this, std::placeholders::_1)
); );
applicationEventListener->registerCallbackForEventType<Events::DebugSessionFinished>(
std::bind(&Application::onDebugSessionFinished, this, std::placeholders::_1)
);
this->startTargetController(); this->startTargetController();
this->startDebugServer(); this->startDebugServer();
@@ -449,4 +453,10 @@ namespace Bloom
this->shutdown(); this->shutdown();
} }
} }
void Application::onDebugSessionFinished(const Events::DebugSessionFinished& event) {
if (this->environmentConfig->shutdownPostDebugSession) {
this->shutdown();
}
}
} }

View File

@@ -301,5 +301,12 @@ namespace Bloom
* @param event * @param event
*/ */
void onDebugServerThreadStateChanged(const Events::DebugServerThreadStateChanged& event); void onDebugServerThreadStateChanged(const Events::DebugServerThreadStateChanged& event);
/**
* If configured to do so, Bloom will shutdown upon the end of the current debug session.
*
* @param event
*/
void onDebugSessionFinished(const Events::DebugSessionFinished& event);
}; };
} }