Author: tfaber
Date: Sun Aug 10 18:39:05 2014
New Revision: 63853
URL:
http://svn.reactos.org/svn/reactos?rev=63853&view=rev
Log:
[BROWSEUI]
- CComObject cannot be a class member and must be allocated using new. Fixes invalid
free.
Modified:
trunk/reactos/dll/win32/browseui/internettoolbar.cpp
trunk/reactos/dll/win32/browseui/internettoolbar.h
Modified: trunk/reactos/dll/win32/browseui/internettoolbar.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/interne…
==============================================================================
--- trunk/reactos/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] Sun Aug 10 18:39:05
2014
@@ -481,14 +481,13 @@
fLocked = false;
fMenuBandWindow = NULL;
fNavigationWindow = NULL;
- fMenuCallback.AddRef();
+ fMenuCallback = new CComObject<CMenuCallback>();
fToolbarWindow = NULL;
fAdviseCookie = 0;
}
CInternetToolbar::~CInternetToolbar()
{
- fMenuCallback.Release();
}
void CInternetToolbar::AddDockItem(IUnknown *newItem, int bandID, int flags)
@@ -540,7 +539,7 @@
IID_IShellMenu, reinterpret_cast<void **>(menuBar));
if (FAILED(hResult))
return hResult;
- hResult = fMenuCallback.QueryInterface(IID_IShellMenuCallback,
reinterpret_cast<void **>(&callback));
+ hResult = fMenuCallback->QueryInterface(IID_IShellMenuCallback,
reinterpret_cast<void **>(&callback));
if (FAILED(hResult))
return hResult;
hResult = (*menuBar)->Initialize(callback, -1, ANCESTORDEFAULT, SMINIT_HORIZONTAL
| SMINIT_TOPLEVEL);
Modified: trunk/reactos/dll/win32/browseui/internettoolbar.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/browseui/interne…
==============================================================================
--- trunk/reactos/dll/win32/browseui/internettoolbar.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/browseui/internettoolbar.h [iso-8859-1] Sun Aug 10 18:39:05
2014
@@ -90,7 +90,7 @@
CComPtr<IUnknown> fLogoBar; // the reactos
logo
CComPtr<IUnknown> fControlsBar; // navigation
controls
CComPtr<IUnknown> fNavigationBar; // address bar
- CComObject<CMenuCallback> fMenuCallback;
+ CComPtr<CMenuCallback> fMenuCallback;
CComPtr<IOleCommandTarget> fCommandTarget;
GUID fCommandCategory;
HWND fToolbarWindow;