summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-02-21 17:22:31 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-02-21 17:22:31 +0300
commite49d8cad8ed50ca97039bc572d2810a6bd884f2b (patch)
tree80a526b724d3fa552f69af77e1651453ec0dcb50 /plugins
parent12aa166ab2c280b1b8cf4d8507512c750a587de1 (diff)
more code cleaning
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Clist_modern/src/modern_xptheme.cpp24
1 files changed, 6 insertions, 18 deletions
diff --git a/plugins/Clist_modern/src/modern_xptheme.cpp b/plugins/Clist_modern/src/modern_xptheme.cpp
index 031422fa5b..b4345cb657 100644
--- a/plugins/Clist_modern/src/modern_xptheme.cpp
+++ b/plugins/Clist_modern/src/modern_xptheme.cpp
@@ -6,6 +6,11 @@
struct XPTObject : public MZeroedObject
{
+ ~XPTObject()
+ {
+ CloseThemeData(hThemeHandle);
+ }
+
HANDLE hThemeHandle;
HWND hOwnerWindow;
LPCWSTR lpcwClassObject;
@@ -14,12 +19,6 @@ struct XPTObject : public MZeroedObject
static OBJLIST<XPTObject> xptObjectList(1);
static mir_cs xptCS;
-static void _sttXptCloseThemeData(XPTObject * xptObject)
-{
- CloseThemeData(xptObject->hThemeHandle);
- xptObject->hThemeHandle = nullptr;
-}
-
static void _sttXptReloadThemeData(XPTObject * xptObject)
{
CloseThemeData(xptObject->hThemeHandle);
@@ -58,24 +57,13 @@ XPTHANDLE xpt_AddThemeHandle(HWND hwnd, LPCWSTR className)
return (XPTHANDLE)xptObject;
}
-void xpt_FreeThemeHandle(XPTHANDLE xptHandle)
-{
- mir_cslock lck(xptCS);
- if (xpt_IsValidHandle(xptHandle)) {
- XPTObject* xptObject = (XPTObject*)xptHandle;
- _sttXptCloseThemeData(xptObject);
- mir_free(xptHandle);
- xptObjectList.remove(xptObjectList.indexOf(xptObject));
- }
-}
-
void xpt_FreeThemeForWindow(HWND hwnd)
{
mir_cslock lck(xptCS);
for (auto &xptObject : xptObjectList.rev_iter())
if (xptObject->hOwnerWindow == hwnd)
- _sttXptCloseThemeData(xptObjectList.removeItem(&xptObject));
+ xptObjectList.removeItem(&xptObject);
}
void xpt_OnWM_THEMECHANGED()