From 075a1fd1d67c6e347ab40f460819067b947f92f6 Mon Sep 17 00:00:00 2001
From: Yuhang Zhao <zhaoyuhang@rankyee.com>
Date: 周三, 06 12月 2023 18:06:54 +0800
Subject: [PATCH] fix mem leak

---
 src/core/contexts/abstractwindowcontext.cpp |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/core/contexts/abstractwindowcontext.cpp b/src/core/contexts/abstractwindowcontext.cpp
index d0d6ebb..654f918 100644
--- a/src/core/contexts/abstractwindowcontext.cpp
+++ b/src/core/contexts/abstractwindowcontext.cpp
@@ -6,7 +6,11 @@
         : m_host(host), m_delegate(delegate), m_windowHandle(delegate->hostWindow(host)) {
     }
 
-    AbstractWindowContext::~AbstractWindowContext() = default;
+    AbstractWindowContext::~AbstractWindowContext() {
+        if (m_delegate) {
+            delete m_delegate;
+        }
+    }
 
     bool AbstractWindowContext::setHitTestVisible(const QObject *obj, bool visible) {
         Q_ASSERT(obj);

--
Gitblit v1.9.1