From 0bdb0ccac8ece903d668b0df098b72e268a10d71 Mon Sep 17 00:00:00 2001 From: Relintai Date: Tue, 18 Jun 2024 10:38:58 +0200 Subject: [PATCH] Don't access a Message's memory after calling it's destructor in MessageQueue. (Even though the way the code works currently this was not really a bug, but it can easily become one.) --- core/object/message_queue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/object/message_queue.cpp b/core/object/message_queue.cpp index 940de92db..98190fd26 100644 --- a/core/object/message_queue.cpp +++ b/core/object/message_queue.cpp @@ -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