[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - vcl/CustomTarget_qt5_moc.mk vcl/inc vcl/qt5
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Feb 27 20:13:29 UTC 2019
vcl/CustomTarget_qt5_moc.mk | 1 +
vcl/inc/qt5/Qt5Object.hxx | 5 ++++-
vcl/qt5/Qt5Instance.cxx | 18 ++++++++++++++++--
vcl/qt5/Qt5Object.cxx | 1 +
4 files changed, 22 insertions(+), 3 deletions(-)
New commits:
commit e0e3064e43dd21f9d91805718618625ac4fb29d7
Author: Aleksei Nikiforov <darktemplar at basealt.ru>
AuthorDate: Mon Feb 25 14:40:45 2019 +0300
Commit: Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Wed Feb 27 21:13:05 2019 +0100
tdf#123406 KDE5: Use delayed frame destruction
Destroy Qt5Frame after all events are received.
Update Qt5Object to use delayed destruction too.
Change-Id: I07c7251e097ad56f3616f325fdc394d00fec4f4f
Reviewed-on: https://gerrit.libreoffice.org/68316
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
(cherry picked from commit 5fe551931d49a64ca4ea793a5016c098e41e84cd)
Reviewed-on: https://gerrit.libreoffice.org/68414
Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>
diff --git a/vcl/CustomTarget_qt5_moc.mk b/vcl/CustomTarget_qt5_moc.mk
index 55e9dcee9cd3..289fea74aa2e 100644
--- a/vcl/CustomTarget_qt5_moc.mk
+++ b/vcl/CustomTarget_qt5_moc.mk
@@ -16,6 +16,7 @@ $(call gb_CustomTarget_get_target,vcl/qt5) : \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Instance.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5MainWindow.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Menu.moc \
+ $(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Object.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Timer.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5Widget.moc \
$(call gb_CustomTarget_get_workdir,vcl/qt5)/Qt5XAccessible.moc \
diff --git a/vcl/inc/qt5/Qt5Object.hxx b/vcl/inc/qt5/Qt5Object.hxx
index 640c83753deb..6d30dfb6d388 100644
--- a/vcl/inc/qt5/Qt5Object.hxx
+++ b/vcl/inc/qt5/Qt5Object.hxx
@@ -22,14 +22,17 @@
#include <salobj.hxx>
#include <vcl/sysdata.hxx>
+#include <QtCore/QObject>
#include <QtGui/QRegion>
class Qt5Frame;
class QWidget;
class QWindow;
-class Qt5Object : public SalObject
+class Qt5Object : public QObject, public SalObject
{
+ Q_OBJECT
+
friend class Qt5OpenGLContext;
SystemEnvData m_aSystemData;
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index 3d9f78b876d8..adbe70bfb296 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -89,7 +89,14 @@ SalFrame* Qt5Instance::CreateFrame(SalFrame* pParent, SalFrameStyleFlags nStyle)
return new Qt5Frame(static_cast<Qt5Frame*>(pParent), nStyle, m_bUseCairo);
}
-void Qt5Instance::DestroyFrame(SalFrame* pFrame) { delete pFrame; }
+void Qt5Instance::DestroyFrame(SalFrame* pFrame)
+{
+ if (pFrame)
+ {
+ assert(dynamic_cast<Qt5Frame*>(pFrame));
+ static_cast<Qt5Frame*>(pFrame)->deleteLater();
+ }
+}
SalObject* Qt5Instance::CreateObject(SalFrame* pParent, SystemWindowData*, bool bShow)
{
@@ -97,7 +104,14 @@ SalObject* Qt5Instance::CreateObject(SalFrame* pParent, SystemWindowData*, bool
return new Qt5Object(static_cast<Qt5Frame*>(pParent), bShow);
}
-void Qt5Instance::DestroyObject(SalObject* pObject) { delete pObject; }
+void Qt5Instance::DestroyObject(SalObject* pObject)
+{
+ if (pObject)
+ {
+ assert(dynamic_cast<Qt5Object*>(pObject));
+ static_cast<Qt5Object*>(pObject)->deleteLater();
+ }
+}
std::unique_ptr<SalVirtualDevice>
Qt5Instance::CreateVirtualDevice(SalGraphics* pGraphics, long& nDX, long& nDY, DeviceFormat eFormat,
diff --git a/vcl/qt5/Qt5Object.cxx b/vcl/qt5/Qt5Object.cxx
index e498283ef1ee..3787bc715976 100644
--- a/vcl/qt5/Qt5Object.cxx
+++ b/vcl/qt5/Qt5Object.cxx
@@ -18,6 +18,7 @@
*/
#include <Qt5Object.hxx>
+#include <Qt5Object.moc>
#include <Qt5Frame.hxx>
More information about the Libreoffice-commits
mailing list