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; }