summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/intent-server-lib/intentserver.cpp2
-rw-r--r--src/launcher-lib/applicationmanagerwindow.cpp5
-rw-r--r--src/launcher-lib/launchermain.cpp4
-rw-r--r--src/launcher-lib/launchermain.h2
-rw-r--r--src/main-lib/main.h2
-rw-r--r--src/manager-lib/applicationmodel.cpp5
-rw-r--r--src/manager-lib/applicationmodel.h1
-rw-r--r--src/manager-lib/packagemanager.cpp9
-rw-r--r--src/shared-main-lib/sharedmain.cpp2
-rw-r--r--src/window-lib/waylandcompositor.cpp12
-rw-r--r--src/window-lib/waylandcompositor.h2
11 files changed, 40 insertions, 6 deletions
diff --git a/src/intent-server-lib/intentserver.cpp b/src/intent-server-lib/intentserver.cpp
index f8377579..ead64771 100644
--- a/src/intent-server-lib/intentserver.cpp
+++ b/src/intent-server-lib/intentserver.cpp
@@ -280,6 +280,8 @@ void IntentServer::removeIntent(Intent *intent)
endRemoveRows();
emit countChanged();
+
+ delete intent;
}
}
diff --git a/src/launcher-lib/applicationmanagerwindow.cpp b/src/launcher-lib/applicationmanagerwindow.cpp
index d5d6d441..f2f4bd5b 100644
--- a/src/launcher-lib/applicationmanagerwindow.cpp
+++ b/src/launcher-lib/applicationmanagerwindow.cpp
@@ -43,7 +43,7 @@ QT_BEGIN_NAMESPACE_AM
class ApplicationManagerWindowPrivate
{
public:
- LauncherMain *launcherMain = nullptr;
+ QPointer<LauncherMain> launcherMain = nullptr;
};
@@ -126,7 +126,8 @@ ApplicationManagerWindow::ApplicationManagerWindow(QWindow *parent)
ApplicationManagerWindow::~ApplicationManagerWindow()
{
- d->launcherMain->clearWindowPropertyCache(this);
+ if (d->launcherMain)
+ d->launcherMain->clearWindowPropertyCache(this);
delete d;
}
diff --git a/src/launcher-lib/launchermain.cpp b/src/launcher-lib/launchermain.cpp
index 5bc567b0..307afc07 100644
--- a/src/launcher-lib/launchermain.cpp
+++ b/src/launcher-lib/launchermain.cpp
@@ -67,8 +67,8 @@ LauncherMain *LauncherMain::instance()
void LauncherMain::registerWaylandExtensions() Q_DECL_NOEXCEPT
{
#if defined(QT_WAYLANDCLIENT_LIB)
- m_waylandExtension = new WaylandQtAMClientExtension();
- connect(m_waylandExtension, &WaylandQtAMClientExtension::windowPropertyChanged,
+ m_waylandExtension.reset(new WaylandQtAMClientExtension());
+ connect(m_waylandExtension.get(), &WaylandQtAMClientExtension::windowPropertyChanged,
this, &LauncherMain::windowPropertyChanged);
#endif
}
diff --git a/src/launcher-lib/launchermain.h b/src/launcher-lib/launchermain.h
index dccad3c9..b01fe218 100644
--- a/src/launcher-lib/launchermain.h
+++ b/src/launcher-lib/launchermain.h
@@ -100,7 +100,7 @@ private:
QStringList m_iconThemeSearchPaths;
QVariant m_useAMConsoleLogger;
#if defined(QT_WAYLANDCLIENT_LIB)
- WaylandQtAMClientExtension *m_waylandExtension = nullptr;
+ QScopedPointer<WaylandQtAMClientExtension> m_waylandExtension;
#endif
};
diff --git a/src/main-lib/main.h b/src/main-lib/main.h
index 838962cb..1e1271a3 100644
--- a/src/main-lib/main.h
+++ b/src/main-lib/main.h
@@ -78,7 +78,7 @@ class Main : public MainBase, protected SharedMain
public:
Main(int &argc, char **argv);
- ~Main();
+ ~Main() override;
bool isSingleProcessMode() const;
bool isRunningOnEmbedded() const;
diff --git a/src/manager-lib/applicationmodel.cpp b/src/manager-lib/applicationmodel.cpp
index 6b304bb7..620a52dc 100644
--- a/src/manager-lib/applicationmodel.cpp
+++ b/src/manager-lib/applicationmodel.cpp
@@ -149,6 +149,11 @@ ApplicationModel::ApplicationModel(QObject *parent)
connect(this, &QAbstractItemModel::modelReset, this, &ApplicationModel::countChanged);
}
+ApplicationModel::~ApplicationModel()
+{
+ delete d;
+}
+
int ApplicationModel::count() const
{
return rowCount();
diff --git a/src/manager-lib/applicationmodel.h b/src/manager-lib/applicationmodel.h
index 04bed28e..5a242101 100644
--- a/src/manager-lib/applicationmodel.h
+++ b/src/manager-lib/applicationmodel.h
@@ -53,6 +53,7 @@ class ApplicationModel : public QSortFilterProxyModel
public:
ApplicationModel(QObject *parent = nullptr);
+ ~ApplicationModel() override;
int count() const;
diff --git a/src/manager-lib/packagemanager.cpp b/src/manager-lib/packagemanager.cpp
index 16bafa0b..f8b1a06b 100644
--- a/src/manager-lib/packagemanager.cpp
+++ b/src/manager-lib/packagemanager.cpp
@@ -1466,6 +1466,7 @@ bool PackageManager::canceledPackageInstall(const QString &id)
return false;
case Package::BeingInstalled: {
+ // remove the package from the model
int row = d->packages.indexOf(package);
if (row >= 0) {
emit packageAboutToBeRemoved(package->id());
@@ -1473,13 +1474,21 @@ bool PackageManager::canceledPackageInstall(const QString &id)
d->packages.removeAt(row);
endRemoveRows();
}
+
+ // cleanup
package->unblock();
+
+ // it's not yet added to the package db, so we need to delete ourselves
+ delete package->info();
+
delete package;
break;
}
case Package::BeingUpdated:
case Package::BeingDowngraded:
case Package::BeingRemoved:
+ delete d->pendingPackageInfoUpdates.take(package);
+
package->setState(Package::Installed);
package->setProgress(0);
emitDataChanged(package, QVector<int> { IsUpdating });
diff --git a/src/shared-main-lib/sharedmain.cpp b/src/shared-main-lib/sharedmain.cpp
index 82b5ea72..4eca7aa3 100644
--- a/src/shared-main-lib/sharedmain.cpp
+++ b/src/shared-main-lib/sharedmain.cpp
@@ -246,6 +246,8 @@ void SharedMain::setupOpenGL(const QVariantMap &openGLConfiguration)
// check if we got what we requested on the OpenGL side
checkOpenGLFormat("global shared context", globalContext->format());
+
+ qAddPostRoutine([]() { delete qt_gl_global_share_context(); });
#else
Q_UNUSED(openGLConfiguration)
#endif
diff --git a/src/window-lib/waylandcompositor.cpp b/src/window-lib/waylandcompositor.cpp
index 24a487fa..540fd048 100644
--- a/src/window-lib/waylandcompositor.cpp
+++ b/src/window-lib/waylandcompositor.cpp
@@ -154,6 +154,11 @@ WaylandCompositor::WaylandCompositor(QQuickWindow *window, const QString &waylan
, m_amExtension(new WaylandQtAMServerExtension(this))
, m_textInputManager(new QWaylandTextInputManager(this))
{
+ m_wlShell->setParent(this);
+ m_xdgShell->setParent(this);
+ m_amExtension->setParent(this);
+ m_textInputManager->setParent(this);
+
setSocketName(waylandSocketName.toUtf8());
registerOutputWindow(window);
@@ -178,6 +183,13 @@ WaylandCompositor::WaylandCompositor(QQuickWindow *window, const QString &waylan
defaultSeat()->keymap()->setLayout(QLocale::system().name().section(qL1C('_'), 1, 1).toLower());
}
+WaylandCompositor::~WaylandCompositor()
+{
+ // QWayland leaks like sieve everywhere, but we need this explicit delete to be able
+ // to suppress the rest via LSAN leak suppression files
+ delete defaultSeat();
+}
+
void WaylandCompositor::xdgPing(WindowSurface* surface)
{
uint serial = m_xdgShell->ping(surface->client());
diff --git a/src/window-lib/waylandcompositor.h b/src/window-lib/waylandcompositor.h
index 0ada3af0..d97f8cae 100644
--- a/src/window-lib/waylandcompositor.h
+++ b/src/window-lib/waylandcompositor.h
@@ -117,6 +117,8 @@ class WaylandCompositor : public QWaylandQuickCompositor // clazy:exclude=missin
Q_OBJECT
public:
WaylandCompositor(QQuickWindow* window, const QString &waylandSocketName);
+ ~WaylandCompositor() override;
+
void registerOutputWindow(QQuickWindow *window);
WaylandQtAMServerExtension *amExtension();