From 421e1c01266edef07c379cdcaeafe6c91d540ccf Mon Sep 17 00:00:00 2001 From: Kevin Funk Date: Mon, 19 Nov 2018 23:09:30 +0100 Subject: [PATCH] ASAN: Fix memory leak in CalendarPlugin Trace: Indirect leak of 24 byte(s) in 1 object(s) allocated from: #0 0x508a17 in __interceptor_malloc (/home/kfunk/devel/install/kf5/bin/plasmashell+0x508a17) #1 0x7fcf92aa6230 in QHashData::allocateNode(int) /home/kfunk/devel/src/qt5.11/qtbase/src/corelib/tools/qhash.cpp:479:79 #2 0x7fcf7a851d10 in QHash::detach() /home/kfunk/devel/build/qt5.11/qtbase/include/QtCore/../../../../../src/qt5.11/qtbase/src/corelib/tools/qhash.h:275:51 #3 0x7fcf7a8519c9 in QHash::insert(int const&, QByteArray const&) /home/kfunk/devel/build/qt5.11/qtbase/include/QtCore/../../../../../src/qt5.11/qtbase/src/corelib/tools/qhash.h:769:5 #4 0x7fcf7a859736 in EventPluginsModel::EventPluginsModel(EventPluginsManager*) /home/kfunk/devel/src/kf5/plasma-framework/src/declarativeimports/calendar/eventpluginsmanager.cpp:42:17 #5 0x7fcf7a854c55 in EventPluginsManager::EventPluginsManager(QObject*) /home/kfunk/devel/src/kf5/plasma-framework/src/declarativeimports/calendar/eventpluginsmanager.cpp:185:19 ... Subscribers: kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D17031 --- src/declarativeimports/calendar/calendarplugin.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/declarativeimports/calendar/calendarplugin.cpp b/src/declarativeimports/calendar/calendarplugin.cpp index 43b19ea0d..d6ae7b4e0 100644 --- a/src/declarativeimports/calendar/calendarplugin.cpp +++ b/src/declarativeimports/calendar/calendarplugin.cpp @@ -31,10 +31,7 @@ static QObject *event_plugins_manager_provider(QQmlEngine *engine, QJSEngine *sc { Q_UNUSED(scriptEngine) - EventPluginsManager *manager = new EventPluginsManager(); - engine->setObjectOwnership(manager, QQmlEngine::CppOwnership); - - return manager; + return new EventPluginsManager(); } void CalendarPlugin::registerTypes(const char *uri)