From 75ad5f10cbdcf3a42ddb632478c12315b80210d3 Mon Sep 17 00:00:00 2001 From: xzl Date: Tue, 18 Jul 2023 09:20:57 +0800 Subject: [PATCH] fix: fix memory leak in danchors.cpp Log: --- include/widgets/danchors.h | 2 +- src/widgets/danchors.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/widgets/danchors.h b/include/widgets/danchors.h index 10efb4efb..caa275f1c 100644 --- a/include/widgets/danchors.h +++ b/include/widgets/danchors.h @@ -191,7 +191,7 @@ private Q_SLOTS: private: DAnchorsBase(QWidget *w, bool); - QExplicitlySharedDataPointer d_ptr; + QExplicitlySharedDataPointer d_ptr; Q_DECLARE_PRIVATE(DAnchorsBase) }; diff --git a/src/widgets/danchors.cpp b/src/widgets/danchors.cpp index db893e151..e670f88ba 100644 --- a/src/widgets/danchors.cpp +++ b/src/widgets/danchors.cpp @@ -378,6 +378,7 @@ class DAnchorsRect: public QRect class DAnchorsBasePrivate : public QSharedData { +public: DAnchorsBasePrivate(DAnchorsBase *qq): q_ptr(qq) {} ~DAnchorsBasePrivate() {