mirror of
https://github.com/CraftyBoss/SuperMarioOdysseyOnline.git
synced 2024-11-25 12:45:17 +00:00
fix: memory leak if send queue is full
This commit is contained in:
parent
ad79fe1732
commit
1b3d763015
1 changed files with 3 additions and 4 deletions
|
@ -541,10 +541,9 @@ void SocketClient::recvFunc() {
|
|||
}
|
||||
|
||||
bool SocketClient::queuePacket(Packet* packet) {
|
||||
if (socket_log_state == SOCKET_LOG_CONNECTED && mPacketQueueOpen) {
|
||||
mSendQueue.push((s64)packet,
|
||||
sead::MessageQueue::BlockType::NonBlocking); // as this is non-blocking, it
|
||||
// will always return true.
|
||||
if (socket_log_state == SOCKET_LOG_CONNECTED && mPacketQueueOpen && !mSendQueue.isFull()) {
|
||||
// as this is non-blocking, it will always return true.
|
||||
mSendQueue.push((s64)packet, sead::MessageQueue::BlockType::NonBlocking);
|
||||
return true;
|
||||
} else {
|
||||
mHeap->free(packet);
|
||||
|
|
Loading…
Reference in a new issue