From e0088b9c9da2b8b4a0bc8578d162f73a3cc91a28 Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Sun, 1 Jul 2018 12:26:50 +0300 Subject: [PATCH] Use qDeleteAll in destructor of Scene class Summary: qDeleteAll can be used to delete values in QMap or QHash. Please notice that qDeleteAll calls `delete` only for values, not keys. Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D13822 --- scene.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scene.cpp b/scene.cpp index a12e974293..b5ffc541ab 100644 --- a/scene.cpp +++ b/scene.cpp @@ -100,9 +100,7 @@ Scene::Scene(QObject *parent) Scene::~Scene() { - foreach (Window *w, m_windows) { - delete w; - } + qDeleteAll(m_windows); } // returns mask and possibly modified region