Skip to content

Commit

Permalink
Don't access a Message's memory after calling it's destructor in Mess…
Browse files Browse the repository at this point in the history
…ageQueue. (Even though the way the code works currently this was not really a bug, but it can easily become one.)
  • Loading branch information
Relintai committed Jun 18, 2024
1 parent 05f19a0 commit 0bdb0cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/object/message_queue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,12 @@ MessageQueue::~MessageQueue() {
}
}

message->~Message();

read_pos += sizeof(Message);
if ((message->type & FLAG_MASK) != TYPE_NOTIFICATION) {
read_pos += sizeof(Variant) * message->args;
}

message->~Message();
}

} // for which
Expand Down

0 comments on commit 0bdb0cc

Please sign in to comment.