From 2d6b7b3f46416aaa15c82c5b466bc0b3e940fb5c Mon Sep 17 00:00:00 2001 From: Uwe Rathmann Date: Thu, 20 Apr 2023 10:26:08 +0200 Subject: [PATCH] memory leak fixed --- src/common/QskMetaInvokable.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/common/QskMetaInvokable.cpp b/src/common/QskMetaInvokable.cpp index e0364614..22a9aeba 100644 --- a/src/common/QskMetaInvokable.cpp +++ b/src/common/QskMetaInvokable.cpp @@ -249,8 +249,16 @@ static void qskInvokeMetaCall( if ( receiver.isNull() ) { - // object might have died in the meantime - free( arguments ); + /* + receiver might have died in the meantime. + We create a dummy event, so that the arguments + are freed by its destructor. + */ + + const MetaCallEvent cleanUpEvent( + call, metaObject->d.static_metacall, + offset, index, arguments, nullptr ); + return; }