Avoid some memory leaks at shutdown

StatusBarManager needs to delete its contexts when dropping them,
QActions should be parented, and in ProjectWindow we can save an
allocation.

Change-Id: Idee075d4f2ce8014f22f73453987d1ab6539cf18
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
Ulf Hermann
2018-02-16 14:52:05 +01:00
parent 37aea43479
commit 1b0d6e3c26
3 changed files with 6 additions and 3 deletions

View File

@@ -95,8 +95,10 @@ static void createStatusBarManager()
QObject::connect(ICore::instance(), &ICore::coreAboutToClose, [] {
// This is the catch-all on rampdown. Individual items may
// have been removed earlier by destroyStatusBarWidget().
for (const QPointer<IContext> &context : m_contexts)
for (const QPointer<IContext> &context : m_contexts) {
ICore::removeContextObject(context);
delete context;
}
m_contexts.clear();
});
}