Author: tfaber
Date: Wed May 3 11:09:04 2017
New Revision: 74454
URL:
http://svn.reactos.org/svn/reactos?rev=74454&view=rev
Log:
[0.4.5]
- Merge Giannis's browseui leak fix from r74441.
Modified:
branches/ros-branch-0_4_5/ (props changed)
branches/ros-branch-0_4_5/reactos/ (props changed)
branches/ros-branch-0_4_5/reactos/dll/win32/browseui/addressband.cpp
branches/ros-branch-0_4_5/reactos/dll/win32/browseui/addressband.h
branches/ros-branch-0_4_5/reactos/dll/win32/browseui/toolsband.cpp
Propchange: branches/ros-branch-0_4_5/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 3 11:09:04 2017
@@ -1,2 +1,2 @@
/branches/colins-printing-for-freedom:67543-68405,68407-68414,68417-70595
-/trunk:74437
+/trunk:74437,74441
Propchange: branches/ros-branch-0_4_5/reactos/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 3 11:09:04 2017
@@ -23,4 +23,4 @@
/branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
/branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567
/branches/wlan-bringup:54809-54998
-/trunk/reactos:74437
+/trunk/reactos:74437,74441
Modified: branches/ros-branch-0_4_5/reactos/dll/win32/browseui/addressband.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_5/reactos/dll/wi…
==============================================================================
--- branches/ros-branch-0_4_5/reactos/dll/win32/browseui/addressband.cpp [iso-8859-1]
(original)
+++ branches/ros-branch-0_4_5/reactos/dll/win32/browseui/addressband.cpp [iso-8859-1] Wed
May 3 11:09:04 2017
@@ -205,6 +205,12 @@
if (fAddressEditBox) fAddressEditBox.Release();
if (fSite) fSite.Release();
+ if (m_himlNormal)
+ ImageList_Destroy(m_himlNormal);
+
+ if (m_himlHot)
+ ImageList_Destroy(m_himlHot);
+
return S_OK;
}
@@ -521,15 +527,12 @@
void CAddressBand::CreateGoButton()
{
const TBBUTTON buttonInfo [] = { { 0, 1, TBSTATE_ENABLED, 0 } };
- HIMAGELIST normalImagelist;
- HIMAGELIST hotImageList;
HINSTANCE shellInstance;
-
shellInstance = GetModuleHandle(_T("shell32.dll"));
- normalImagelist = ImageList_LoadImageW(shellInstance,
MAKEINTRESOURCE(IDB_GOBUTTON_NORMAL),
+ m_himlNormal = ImageList_LoadImageW(shellInstance,
MAKEINTRESOURCE(IDB_GOBUTTON_NORMAL),
20, 0, RGB(255, 0, 255), IMAGE_BITMAP,
LR_CREATEDIBSECTION);
- hotImageList = ImageList_LoadImageW(shellInstance,
MAKEINTRESOURCE(IDB_GOBUTTON_HOT),
+ m_himlHot = ImageList_LoadImageW(shellInstance, MAKEINTRESOURCE(IDB_GOBUTTON_HOT),
20, 0, RGB(255, 0, 255), IMAGE_BITMAP,
LR_CREATEDIBSECTION);
fGoButton = CreateWindowEx(WS_EX_TOOLWINDOW, TOOLBARCLASSNAMEW, 0, WS_CHILD |
WS_CLIPSIBLINGS |
@@ -538,10 +541,10 @@
0, 0, 0, 0, m_hWnd, NULL,
_AtlBaseModule.GetModuleInstance(), NULL);
SendMessage(fGoButton, TB_BUTTONSTRUCTSIZE, sizeof(TBBUTTON), 0);
SendMessage(fGoButton, TB_SETMAXTEXTROWS, 1, 0);
- if (normalImagelist)
- SendMessage(fGoButton, TB_SETIMAGELIST, 0,
reinterpret_cast<LPARAM>(normalImagelist));
- if (hotImageList)
- SendMessage(fGoButton, TB_SETHOTIMAGELIST, 0,
reinterpret_cast<LPARAM>(hotImageList));
+ if (m_himlNormal)
+ SendMessage(fGoButton, TB_SETIMAGELIST, 0,
reinterpret_cast<LPARAM>(m_himlNormal));
+ if (m_himlHot)
+ SendMessage(fGoButton, TB_SETHOTIMAGELIST, 0,
reinterpret_cast<LPARAM>(m_himlHot));
SendMessage(fGoButton, TB_ADDSTRINGW,
reinterpret_cast<WPARAM>(_AtlBaseModule.GetResourceInstance()),
IDS_GOBUTTONLABEL);
SendMessage(fGoButton, TB_ADDBUTTONSW, 1, (LPARAM) &buttonInfo);
Modified: branches/ros-branch-0_4_5/reactos/dll/win32/browseui/addressband.h
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_5/reactos/dll/wi…
==============================================================================
--- branches/ros-branch-0_4_5/reactos/dll/win32/browseui/addressband.h [iso-8859-1]
(original)
+++ branches/ros-branch-0_4_5/reactos/dll/win32/browseui/addressband.h [iso-8859-1] Wed
May 3 11:09:04 2017
@@ -41,6 +41,9 @@
HWND fGoButton;
HWND fComboBox;
bool fGoButtonShown;
+ HIMAGELIST m_himlNormal;
+ HIMAGELIST m_himlHot;
+
public:
CAddressBand();
virtual ~CAddressBand();
Modified: branches/ros-branch-0_4_5/reactos/dll/win32/browseui/toolsband.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_5/reactos/dll/wi…
==============================================================================
--- branches/ros-branch-0_4_5/reactos/dll/win32/browseui/toolsband.cpp [iso-8859-1]
(original)
+++ branches/ros-branch-0_4_5/reactos/dll/win32/browseui/toolsband.cpp [iso-8859-1] Wed
May 3 11:09:04 2017
@@ -40,6 +40,8 @@
CComPtr<IDockingWindowSite> fDockSite;
GUID fExecCommandCategory;
CComPtr<IOleCommandTarget> fExecCommandTarget;
+ HIMAGELIST m_himlNormal;
+ HIMAGELIST m_himlHot;
public:
CToolsBand();
virtual ~CToolsBand();
@@ -294,36 +296,16 @@
SendMessage(TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_HIDECLIPPEDBUTTONS |
TBSTYLE_EX_MIXEDBUTTONS | TBSTYLE_EX_DRAWDDARROWS);
HINSTANCE shell32Instance = GetModuleHandle(_T("shell32.dll"));
- HBITMAP imgNormal = reinterpret_cast<HBITMAP>(
- LoadImage(shell32Instance, MAKEINTRESOURCE(214),
- IMAGE_BITMAP, 0, 0, LR_DEFAULTSIZE | LR_CREATEDIBSECTION));
-
- HBITMAP imgHot = reinterpret_cast<HBITMAP>(
- LoadImage(shell32Instance, MAKEINTRESOURCE(215),
- IMAGE_BITMAP, 0, 0, LR_DEFAULTSIZE | LR_CREATEDIBSECTION));
-
- if (imgNormal && imgHot)
- {
- BITMAP bitmapInfo;
- GetObjectW(imgNormal, sizeof(bitmapInfo), &bitmapInfo);
- HIMAGELIST himlNormal = ImageList_Create(bitmapInfo.bmHeight,
bitmapInfo.bmHeight, ILC_COLOR32, 4, 4);
- ImageList_Add(himlNormal, imgNormal, NULL);
-
- GetObjectW(imgHot, sizeof(bitmapInfo), &bitmapInfo);
- HIMAGELIST himlHot = ImageList_Create(bitmapInfo.bmHeight, bitmapInfo.bmHeight,
ILC_COLOR32, 4, 4);
- ImageList_Add(himlHot, imgHot, NULL);
-
- SendMessage(TB_SETIMAGELIST, 0, (LPARAM) himlNormal);
- SendMessage(TB_SETHOTIMAGELIST, 0, (LPARAM) himlHot);
- }
-
+ m_himlNormal = ImageList_LoadImageW(shell32Instance, MAKEINTRESOURCE(214),
+ 0, 0, RGB(255, 0, 255), IMAGE_BITMAP,
LR_DEFAULTSIZE | LR_CREATEDIBSECTION);
+
+ m_himlHot = ImageList_LoadImageW(shell32Instance, MAKEINTRESOURCE(215),
+ 0, 0, RGB(255, 0, 255), IMAGE_BITMAP,
LR_DEFAULTSIZE | LR_CREATEDIBSECTION);
+
+ SendMessage(TB_SETIMAGELIST, 0, (LPARAM) m_himlNormal);
+ SendMessage(TB_SETHOTIMAGELIST, 0, (LPARAM) m_himlHot);
SendMessage(TB_ADDBUTTONSW, numShownButtons, (LPARAM)&tbButtonsAdd);
- if (imgNormal)
- DeleteObject(imgNormal);
- if (imgHot)
- DeleteObject(imgHot);
-
return hResult;
}
@@ -344,7 +326,6 @@
HRESULT STDMETHODCALLTYPE CToolsBand::ContextSensitiveHelp(BOOL fEnterMode)
{
-
return E_NOTIMPL;
}
@@ -357,7 +338,14 @@
m_hWnd = NULL;
- if (fDockSite) fDockSite.Release();
+ if (fDockSite)
+ fDockSite.Release();
+
+ if (m_himlNormal)
+ ImageList_Destroy(m_himlNormal);
+
+ if (m_himlHot)
+ ImageList_Destroy(m_himlHot);
return S_OK;
}