summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mir_app/src/IcoLib.h1
-rw-r--r--src/mir_app/src/icolib.cpp7
-rw-r--r--src/mir_app/src/skin2opts.cpp17
3 files changed, 2 insertions, 23 deletions
diff --git a/src/mir_app/src/IcoLib.h b/src/mir_app/src/IcoLib.h
index a1637d4f03..9474295ac1 100644
--- a/src/mir_app/src/IcoLib.h
+++ b/src/mir_app/src/IcoLib.h
@@ -118,6 +118,5 @@ extern LIST<IcolibItem> iconList;
extern LIST<SectionItem> sectionList;
extern BOOL bNeedRebuild;
-extern int iconEventActive;
extern HICON hIconBlank;
extern HANDLE hIconsChangedEvent;
diff --git a/src/mir_app/src/icolib.cpp b/src/mir_app/src/icolib.cpp
index 6069202925..c5d86d2329 100644
--- a/src/mir_app/src/icolib.cpp
+++ b/src/mir_app/src/icolib.cpp
@@ -32,8 +32,6 @@ HANDLE hIconsChangedEvent;
HICON hIconBlank = nullptr;
-int iconEventActive = 0;
-
BOOL bNeedRebuild = FALSE;
mir_cs csIconList;
@@ -538,10 +536,7 @@ static int ReleaseIconInternal(IcolibItem *item, bool big)
IconSourceItem *source = big && !item->cx ? item->source_big : item->source_small;
if (source && source->icon_ref_count) {
- if (iconEventActive)
- source->icon_ref_count--;
- else
- source->releaseIcon();
+ source->releaseIcon();
return 0;
}
diff --git a/src/mir_app/src/skin2opts.cpp b/src/mir_app/src/skin2opts.cpp
index 03aec37087..ce96b5ae68 100644
--- a/src/mir_app/src/skin2opts.cpp
+++ b/src/mir_app/src/skin2opts.cpp
@@ -152,7 +152,7 @@ static wchar_t* OpenFileDlg(HWND hParent, const wchar_t *szFile, BOOL bAll)
class CIconImportDlg : public CDlgBase
{
- HWND m_hwndDragOver;
+ HWND m_hwndDragOver = nullptr;
int m_iDragItem = 0, m_iDropHiLite = 0;
bool m_bDragging = false;
@@ -484,22 +484,7 @@ class CIcoLibOptsDlg : public CDlgBase
void DoIconsChanged()
{
UpdateIconsPreview();
-
- iconEventActive = 1; // Disable icon destroying - performance boost
NotifyEventHooks(hIconsChangedEvent, 0, 0);
- iconEventActive = 0;
-
- mir_cslock lck(csIconList); // Destroy unused icons
- for (auto &it : iconList) {
- if (it->source_small && !it->source_small->icon_ref_count) {
- it->source_small->icon_ref_count++;
- it->source_small->releaseIcon();
- }
- if (it->source_big && !it->source_big->icon_ref_count) {
- it->source_big->icon_ref_count++;
- it->source_big->releaseIcon();
- }
- }
}
void LoadSubIcons(wchar_t *filename, HTREEITEM hItem)