Fixed seg fault bug on debug server startup failure

This commit is contained in:
Nav
2022-09-16 20:49:36 +01:00
parent 748d2d3240
commit c9608f835e

View File

@@ -80,7 +80,8 @@ namespace Bloom::DebugServer
}
void DebugServerComponent::shutdown() {
if (this->getThreadState() == ThreadState::STOPPED
if (
this->getThreadState() == ThreadState::STOPPED
|| this->getThreadState() == ThreadState::SHUTDOWN_INITIATED
) {
return;
@@ -88,7 +89,11 @@ namespace Bloom::DebugServer
this->setThreadState(ThreadState::SHUTDOWN_INITIATED);
Logger::info("Shutting down DebugServer");
if (this->server) {
this->server->close();
}
this->setThreadStateAndEmitEvent(ThreadState::STOPPED);
this->eventListener->setInterruptEventNotifier(nullptr);