From f652b754a0adb3f0a94d30ffad88753d4cbd71ef Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Sat, 26 Dec 2015 23:38:41 +0900 Subject: [PATCH] There is no need to call DestroyIcon() function for icons loaded with LoadIcon() function --- Src/ChildFrm.cpp | 12 ------------ Src/Common/MessageBoxDialog.cpp | 9 --------- Src/DirFrame.cpp | 12 ------------ Src/HexMergeFrm.cpp | 12 ------------ Src/ImgMergeFrm.cpp | 12 ------------ 5 files changed, 57 deletions(-) diff --git a/Src/ChildFrm.cpp b/Src/ChildFrm.cpp index cf7efc02e..14c8be8ac 100644 --- a/Src/ChildFrm.cpp +++ b/Src/ChildFrm.cpp @@ -506,18 +506,6 @@ BOOL CChildFrame::DestroyWindow() theApp.WriteProfileInt(_T("Settings"), _T("ActiveFrameMax"), (wp.showCmd == SW_MAXIMIZE)); } - if (m_hIdentical != NULL) - { - DestroyIcon(m_hIdentical); - m_hIdentical = NULL; - } - - if (m_hDifferent != NULL) - { - DestroyIcon(m_hDifferent); - m_hDifferent = NULL; - } - return CMDIChildWnd::DestroyWindow(); } diff --git a/Src/Common/MessageBoxDialog.cpp b/Src/Common/MessageBoxDialog.cpp index 703448711..e1e71f470 100644 --- a/Src/Common/MessageBoxDialog.cpp +++ b/Src/Common/MessageBoxDialog.cpp @@ -167,15 +167,6 @@ CMessageBoxDialog::CMessageBoxDialog ( CWnd* pParent, UINT nMessageID, */ CMessageBoxDialog::~CMessageBoxDialog ( ) { - // Check whether an icon was loaded. - if ( m_hIcon != NULL ) - { - // Free the icon. - DestroyIcon(m_hIcon); - - // Reset the icon handle. - m_hIcon = NULL; - } } ////////////////////////////////////////////////////////////////////////////// diff --git a/Src/DirFrame.cpp b/Src/DirFrame.cpp index 318951afc..f44e5e178 100644 --- a/Src/DirFrame.cpp +++ b/Src/DirFrame.cpp @@ -256,18 +256,6 @@ BOOL CDirFrame::DestroyWindow() theApp.WriteProfileInt(_T("Settings"), _T("ActiveFrameMax"), (wp.showCmd == SW_MAXIMIZE)); } - if (m_hIdentical != NULL) - { - DestroyIcon(m_hIdentical); - m_hIdentical = NULL; - } - - if (m_hDifferent != NULL) - { - DestroyIcon(m_hDifferent); - m_hDifferent = NULL; - } - return CMDIChildWnd::DestroyWindow(); } diff --git a/Src/HexMergeFrm.cpp b/Src/HexMergeFrm.cpp index 6ffeb394b..61655825a 100644 --- a/Src/HexMergeFrm.cpp +++ b/Src/HexMergeFrm.cpp @@ -215,18 +215,6 @@ BOOL CHexMergeFrame::DestroyWindow() theApp.WriteProfileInt(_T("Settings"), _T("ActiveFrameMax"), (wp.showCmd == SW_MAXIMIZE)); } - if (m_hIdentical != NULL) - { - DestroyIcon(m_hIdentical); - m_hIdentical = NULL; - } - - if (m_hDifferent != NULL) - { - DestroyIcon(m_hDifferent); - m_hDifferent = NULL; - } - return CMDIChildWnd::DestroyWindow(); } diff --git a/Src/ImgMergeFrm.cpp b/Src/ImgMergeFrm.cpp index 9d432d417..3f1c14a68 100644 --- a/Src/ImgMergeFrm.cpp +++ b/Src/ImgMergeFrm.cpp @@ -173,18 +173,6 @@ CImgMergeFrame::~CImgMergeFrame() m_pDirDoc = NULL; } - if (m_hIdentical != NULL) - { - DestroyIcon(m_hIdentical); - m_hIdentical = NULL; - } - - if (m_hDifferent != NULL) - { - DestroyIcon(m_hDifferent); - m_hDifferent = NULL; - } - HMODULE hModule = GetModuleHandle(_T("WinIMergeLib.dll")); if (hModule) { -- 2.11.0