From ffde703fe13609e2385789eace1759708c3688b5 Mon Sep 17 00:00:00 2001 From: deepin-ci-robot Date: Tue, 26 Nov 2024 03:51:16 +0000 Subject: [PATCH] sync: from linuxdeepin/dtkgui Synchronize source files from linuxdeepin/dtkgui. Source-pull-request: https://github.com/linuxdeepin/dtkgui/pull/278 --- src/kernel/dplatformhandle.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/kernel/dplatformhandle.cpp b/src/kernel/dplatformhandle.cpp index ee983a6..98f9567 100644 --- a/src/kernel/dplatformhandle.cpp +++ b/src/kernel/dplatformhandle.cpp @@ -419,8 +419,10 @@ DPlatformHandle::DPlatformHandle(QWindow *window, QObject *parent) DPlatformHandle::~DPlatformHandle() { #ifndef DTK_DISABLE_TREELAND - g_platformThemeMap.value(this)->deleteLater(); - g_platformThemeMap.remove(this); + if (auto it = g_platformThemeMap.find(this); it != g_platformThemeMap.end()) { + it.value()->deleteLater(); + g_platformThemeMap.remove(it.key()); + } #endif } @@ -685,7 +687,7 @@ bool DPlatformHandle::setEnabledNoTitlebarForWindow(QWindow *window, bool enable auto handle = dPlatformWindowInterfaceByWindow(window); if (handle) { - handle->setEnabledNoTitlebar(true); + handle->setEnabledNoTitlebar(enable); } return true; }