File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -324,19 +324,18 @@ MessageQueue::~MessageQueue() {
324324
325325 while (read_pos < buffer_end) {
326326 Message *message = (Message *)&buffer[read_pos];
327+ read_pos += sizeof (Message);
328+
327329 Variant *args = (Variant *)(message + 1 );
328330 int argc = message->args ;
329331 if ((message->type & FLAG_MASK) != TYPE_NOTIFICATION) {
330332 for (int i = 0 ; i < argc; i++) {
331333 args[i].~Variant ();
332334 }
335+ read_pos += sizeof (Variant) * argc;
333336 }
334- message->~Message ();
335337
336- read_pos += sizeof (Message);
337- if ((message->type & FLAG_MASK) != TYPE_NOTIFICATION) {
338- read_pos += sizeof (Variant) * message->args ;
339- }
338+ message->~Message ();
340339 }
341340
342341 singleton = nullptr ;
Original file line number Diff line number Diff line change @@ -55,9 +55,9 @@ class MessageQueue {
5555
5656 struct Message {
5757 Callable callable;
58- int16_t type;
58+ int16_t type = 0 ;
5959 union {
60- int16_t notification;
60+ int16_t notification = 0 ;
6161 int16_t args;
6262 };
6363 };
You can’t perform that action at this time.
0 commit comments