1
0
mirror of https://github.com/anope/anope.git synced 2026-07-07 11:43:12 +02:00

Try to ensure we only have use Stats instance.

This probably only happens when a user has a broken database but
its best to be more robust.
This commit is contained in:
Sadie Powell
2025-05-10 00:35:34 +01:00
parent eec428b0c7
commit b4150841ec
+4 -3
View File
@@ -19,7 +19,8 @@ struct Stats final
Stats() : Serializable("Stats")
{
me = this;
if (!me)
me = this;
}
};
@@ -45,7 +46,7 @@ struct StatsType final
}
};
Stats *Stats::me;
Stats *Stats::me = nullptr;
/**
* Count servers connected to server s
@@ -340,7 +341,7 @@ public:
void OnUserConnect(User *u, bool &exempt) override
{
if (UserListByNick.size() == MaxUserCount && Anope::CurTime == MaxUserTime)
stats_saver.QueueUpdate();
Stats::me->QueueUpdate();
}
};