From 50baef55bf5aeac4de7f5e88f2524a83f1bd7a7e Mon Sep 17 00:00:00 2001 From: sdottaka Date: Mon, 29 Sep 2014 02:01:20 +0900 Subject: [PATCH] ImgMergeFrm.cpp: Did not remove *.ficache file when exiting WinMerge --HG-- branch : stable --- Src/ImgMergeFrm.cpp | 72 ++++++++++++++++++++++++++--------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/Src/ImgMergeFrm.cpp b/Src/ImgMergeFrm.cpp index 465396ba9..3f249e413 100644 --- a/Src/ImgMergeFrm.cpp +++ b/Src/ImgMergeFrm.cpp @@ -157,6 +157,7 @@ CImgMergeFrame::CImgMergeFrame() , m_hDifferent(NULL) , m_pDirDoc(NULL) , m_bAutoMerged(false) +, m_pImgMergeWindow(NULL) { for (int pane = 0; pane < 3; ++pane) { @@ -167,6 +168,29 @@ CImgMergeFrame::CImgMergeFrame() CImgMergeFrame::~CImgMergeFrame() { + 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) + { + bool (*WinIMerge_DestroyWindow)(IImgMergeWindow *) = + (bool (*)(IImgMergeWindow *))GetProcAddress(hModule, "WinIMerge_DestroyWindow"); + if (WinIMerge_DestroyWindow) + { + WinIMerge_DestroyWindow(m_pImgMergeWindow); + m_pImgMergeWindow = NULL; + } + } } bool CImgMergeFrame::OpenImages(const PathContext& paths, const bool bRO[], int nPane, CMDIFrameWnd *pParent) @@ -407,30 +431,6 @@ BOOL CImgMergeFrame::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; - } - - HMODULE hModule = GetModuleHandle(_T("WinIMergeLib.dll")); - if (hModule) - { - bool (*WinIMerge_DestroyWindow)(IImgMergeWindow *) = - (bool (*)(IImgMergeWindow *))GetProcAddress(hModule, "WinIMerge_DestroyWindow"); - if (WinIMerge_DestroyWindow) - { - WinIMerge_DestroyWindow(m_pImgMergeWindow); - m_pImgMergeWindow = NULL; - } - } - return CMDIChildWnd::DestroyWindow(); } @@ -1149,18 +1149,18 @@ void CImgMergeFrame::OnIdleUpdateCmdUI() UpdateHeaderPath(pane); m_wndFilePathBar.SetActive(pane, pane == m_pImgMergeWindow->GetActivePane()); String text; - if (pt.x >= 0 && pt.y >= 0 && - pt.x < m_pImgMergeWindow->GetImageWidth(pane) && - pt.y < m_pImgMergeWindow->GetImageHeight(pane)) - { - text += string_format(_T("Pt:(%d,%d) RGBA:(%d,%d,%d,%d) "), pt.x, pt.y, - color[pane].rgbRed, color[pane].rgbGreen, color[pane].rgbBlue, color[pane].rgbReserved); - if (pane == 1 && m_pImgMergeWindow->GetPaneCount() == 3) - text += string_format(_T("Dist:%g,%g "), colorDistance01, colorDistance12); - else - text += string_format(_T("Dist:%g "), colorDistance01); - } - + if (pt.x >= 0 && pt.y >= 0 && + pt.x < m_pImgMergeWindow->GetImageWidth(pane) && + pt.y < m_pImgMergeWindow->GetImageHeight(pane)) + { + text += string_format(_T("Pt:(%d,%d) RGBA:(%d,%d,%d,%d) "), pt.x, pt.y, + color[pane].rgbRed, color[pane].rgbGreen, color[pane].rgbBlue, color[pane].rgbReserved); + if (pane == 1 && m_pImgMergeWindow->GetPaneCount() == 3) + text += string_format(_T("Dist:%g,%g "), colorDistance01, colorDistance12); + else + text += string_format(_T("Dist:%g "), colorDistance01); + } + text += string_format(_T("Page:%d/%d Zoom:%d%% %dx%dpx %dbpp"), m_pImgMergeWindow->GetCurrentPage(pane) + 1, m_pImgMergeWindow->GetPageCount(pane), -- 2.11.0