mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
Added MemoryManager object watcher for object leak debugging, improved SPL Thread/Worker stopping, fixed some possible weak references crashing unexpectedly
This commit is contained in:
@ -465,21 +465,8 @@ namespace pocketmine {
|
||||
$logger->info("Stopping other threads");
|
||||
|
||||
foreach(ThreadManager::getInstance()->getAll() as $id => $thread){
|
||||
if($thread->isRunning()){
|
||||
$logger->debug("Killing " . (new \ReflectionClass($thread))->getShortName() . " thread");
|
||||
$thread->kill();
|
||||
sleep(1);
|
||||
$thread->detach();
|
||||
}elseif(!$thread->isJoined()){
|
||||
if(!$thread->isTerminated()){
|
||||
$logger->debug("Joining " . (new \ReflectionClass($thread))->getShortName() . " thread");
|
||||
$thread->join();
|
||||
}else{
|
||||
$logger->debug("Killing " . (new \ReflectionClass($thread))->getShortName() . " thread");
|
||||
$thread->kill();
|
||||
$thread->detach();
|
||||
}
|
||||
}
|
||||
$logger->debug("Stopping " . (new \ReflectionClass($thread))->getShortName() . " thread");
|
||||
$thread->quit();
|
||||
}
|
||||
|
||||
$logger->shutdown();
|
||||
|
Reference in New Issue
Block a user