Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Beyer <s-beyer@gmx.net>2020-06-24 14:50:17 +0300
committerStephan Beyer <s-beyer@gmx.net>2020-06-24 14:50:17 +0300
commit08cb289b8c49687f4fb917ac81f630246b3bf551 (patch)
tree33feea48791d93e9ac7da017e46b03e2cf1c2d54 /src/gui/owncloudgui.cpp
parent6adb7987284176407a186778670e1a4b0f41aa57 (diff)
Fix SEGV (by circular ownership) at exit
Commit a12205f322d43476230881192616e47c9cf786ef (PR #1891) introduced a circular ownership: qmlRegisterSingletonType<Systray>(...) makes the QQmlEngine own the resulting singleton Systray instance, however, the QQmlEngine _trayEngine itself is owned by the Systray instance. This circular ownership results in a crash when the destructor of Systray calls the destructor of _trayEngine which attempts to call the destructor of Systray. This commit solves this problem by making ownCloudGui, which is the parent of Systray, the parent of the _trayEngine. Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Diffstat (limited to 'src/gui/owncloudgui.cpp')
-rw-r--r--src/gui/owncloudgui.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp
index ef335ffed..5dc280bdc 100644
--- a/src/gui/owncloudgui.cpp
+++ b/src/gui/owncloudgui.cpp
@@ -32,6 +32,7 @@
#include "cloudproviders/cloudprovidermanager.h"
#endif
+#include <QQmlApplicationEngine>
#include <QDesktopServices>
#include <QDir>
#include <QMessageBox>
@@ -66,7 +67,7 @@ ownCloudGui::ownCloudGui(Application *parent)
, _app(parent)
{
_tray = Systray::instance();
- _tray->setParent(this);
+ _tray->setTrayEngine(new QQmlApplicationEngine(this));
// for the beginning, set the offline icon until the account was verified
_tray->setIcon(Theme::instance()->folderOfflineIcon(/*systray?*/ true));