mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-25 12:39:40 +00:00
[Server] Call GC after deleting player
This commit is contained in:
parent
a9614ad28e
commit
410eb353e8
1 changed files with 2 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
#include "Players.hpp"
|
#include "Players.hpp"
|
||||||
|
#include "Networking.hpp"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
@ -87,6 +88,7 @@ void Players::deletePlayerByPID(int pid)
|
||||||
if (it != ls.end())
|
if (it != ls.end())
|
||||||
{
|
{
|
||||||
(*it)->markedForDeletion = true;
|
(*it)->markedForDeletion = true;
|
||||||
|
mwmp::Networking::get().getState().getState()->collect_garbage();
|
||||||
size_t useCount = it->use_count();
|
size_t useCount = it->use_count();
|
||||||
ls.erase(it);
|
ls.erase(it);
|
||||||
LOG_APPEND(Log::LOG_TRACE, "- references: %d", useCount - 1);
|
LOG_APPEND(Log::LOG_TRACE, "- references: %d", useCount - 1);
|
||||||
|
|
Loading…
Reference in a new issue