feat(net): add NETEVENTQUEUE dtor

This commit is contained in:
fallenoak 2025-10-10 20:06:58 -05:00
parent 93edfe896e
commit b925836c2c
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 14 additions and 0 deletions

View File

@ -20,6 +20,10 @@ void InitializePropContext() {
}
}
NETEVENTQUEUE::~NETEVENTQUEUE() {
this->Clear();
}
void NETEVENTQUEUE::AddEvent(EVENTID eventId, void* conn, NetClient* client, const void* data, uint32_t bytes) {
this->m_critSect.Enter();
@ -43,6 +47,14 @@ void NETEVENTQUEUE::AddEvent(EVENTID eventId, void* conn, NetClient* client, con
this->m_critSect.Leave();
}
void NETEVENTQUEUE::Clear() {
this->m_critSect.Enter();
this->m_eventQueue.Clear();
this->m_critSect.Leave();
}
void NETEVENTQUEUE::Poll() {
this->m_critSect.Enter();

View File

@ -41,7 +41,9 @@ class NETEVENTQUEUE {
NETEVENTQUEUE(NetClient* client)
: m_client(client)
{};
~NETEVENTQUEUE();
void AddEvent(EVENTID eventId, void* conn, NetClient* client, const void* data, uint32_t bytes);
void Clear();
void Poll();
};