* CMenuBand: Increase the refcount of m_smc before returning it.
* CMenuBand: Improve the closing logic so that the object is reusable when it needs to be, and can still be released properly.
* CMenuDeskBar: Protect self against unexpected termination.
* CMenuFocusManager: Refcount objects that are being used.
* CStartMenu: Properly release the created objects after it's done using them (by using CComPtr instead of raw pointers).

[BROWSEUI]
* AddressBand: Release the addressband site when closing the band.
* InternetToolbar: Do not filter away ALL the items of the favorites folder.
* InternetToolbar: Do not AddRef a CComPtr that already did the refcounting itself.

CORE-8690

svn path=/branches/shell-experiments/; revision=64929
This commit is contained in:
David Quintana
2014-10-23 17:17:16 +00:00
parent 121e60dbda
commit 1cd79168e1
9 changed files with 248 additions and 39 deletions
+15 -7
View File
@@ -759,7 +759,9 @@ HRESULT CMenuFocusManager::UpdateFocus()
HRESULT CMenuFocusManager::PushMenuBar(CMenuBand * mb)
{
TRACE("PushTrackedPopup %p\n", mb);
DbgPrint("PushMenuBar %p\n", mb);
mb->AddRef();
_ASSERT(m_bandCount == 0);
@@ -772,7 +774,9 @@ HRESULT CMenuFocusManager::PushMenuBar(CMenuBand * mb)
HRESULT CMenuFocusManager::PushMenuPopup(CMenuBand * mb)
{
TRACE("PushTrackedPopup %p\n", mb);
DbgPrint("PushTrackedPopup %p\n", mb);
mb->AddRef();
_ASSERT(!m_current || m_current->type != TrackedMenuEntry);
@@ -793,7 +797,7 @@ HRESULT CMenuFocusManager::PushMenuPopup(CMenuBand * mb)
HRESULT CMenuFocusManager::PushTrackedPopup(HMENU popup)
{
TRACE("PushTrackedPopup %p\n", popup);
DbgPrint("PushTrackedPopup %p\n", popup);
_ASSERT(m_bandCount > 0);
_ASSERT(!m_current || m_current->type != TrackedMenuEntry);
@@ -802,7 +806,7 @@ HRESULT CMenuFocusManager::PushTrackedPopup(HMENU popup)
if (FAILED_UNEXPECTEDLY(hr))
return hr;
TRACE("PushTrackedPopup %p\n", popup);
DbgPrint("PushTrackedPopup %p\n", popup);
m_selectedMenu = popup;
m_selectedItem = -1;
m_selectedItemFlags = 0;
@@ -816,7 +820,7 @@ HRESULT CMenuFocusManager::PopMenuBar(CMenuBand * mb)
CMenuBand * mbc;
HRESULT hr;
TRACE("PopMenuBar %p\n", mb);
DbgPrint("PopMenuBar %p\n", mb);
hr = PopFromArray(&type, &mbc, NULL);
if (FAILED_UNEXPECTEDLY(hr))
@@ -834,6 +838,8 @@ HRESULT CMenuFocusManager::PopMenuBar(CMenuBand * mb)
mbc->_SetParentBand(NULL);
mbc->Release();
hr = UpdateFocus();
if (FAILED_UNEXPECTEDLY(hr))
return hr;
@@ -853,7 +859,7 @@ HRESULT CMenuFocusManager::PopMenuPopup(CMenuBand * mb)
CMenuBand * mbc;
HRESULT hr;
TRACE("PopMenuPopup %p\n", mb);
DbgPrint("PopMenuPopup %p\n", mb);
hr = PopFromArray(&type, &mbc, NULL);
if (FAILED_UNEXPECTEDLY(hr))
@@ -871,6 +877,8 @@ HRESULT CMenuFocusManager::PopMenuPopup(CMenuBand * mb)
mbc->_SetParentBand(NULL);
mbc->Release();
hr = UpdateFocus();
if (FAILED_UNEXPECTEDLY(hr))
return hr;
@@ -890,7 +898,7 @@ HRESULT CMenuFocusManager::PopTrackedPopup(HMENU popup)
HMENU hmenu;
HRESULT hr;
TRACE("PopTrackedPopup %p\n", popup);
DbgPrint("PopTrackedPopup %p\n", popup);
hr = PopFromArray(&type, NULL, &hmenu);
if (FAILED_UNEXPECTEDLY(hr))