FIX: fixed issue of deleting entity

This commit is contained in:
Henry Winkel
2023-12-19 19:47:20 +01:00
parent 549072fd80
commit 3b4d4baa1b
2 changed files with 19 additions and 10 deletions

View File

@@ -138,15 +138,20 @@ namespace Entities
void Entity::stop()
{
stopChild();
try {
PodController_->stopAllPods();
LOG_S(INFO)<<"Pods stoppt";
stopChild();
LOG_S(INFO)<<"childs stoppt";
MovemtServer_.reset();
// MovemtServer_.reset();
LOG_S(INFO)<<"MovemtServer_ reseted";
stopMainLoop = true;
BroadcastServer_.reset();
// BroadcastServer_.reset();
LOG_S(INFO)<<"BroadcastServer_ reseted";
@@ -154,16 +159,20 @@ namespace Entities
{
if (it->joinable())
{
it->join();
it = threads.erase(it);
}
}
LOG_S(ERROR)<< threads.size();
std::this_thread::sleep_for(std::chrono::milliseconds(30000));
LOG_S(ERROR)<< "Remaining Threads: " << threads.size();
// std::this_thread::sleep_for(std::chrono::milliseconds(30000));
exit(0);
// exit(0);
} catch (const std::exception e) {
LOG_S(ERROR)<< e.what();
}
}
void Entity::startMovementWorker()