mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-03 04:13:31 +00:00
[RSHELL]
* CMenuBand: Refcount before assigning a return pointer. * CMenuDeskBar: Revert change and protect the refcounting in case I was wrong to assume there will be exactly one OnFinalMessage for each OnCreate. * CMenuToolbars: Add a debug message. * CStartMenu: Refcount correctly. svn path=/branches/shell-experiments/; revision=65088
This commit is contained in:
@@ -39,7 +39,8 @@ CMenuDeskBar::CMenuDeskBar() :
|
||||
m_IconSize(0),
|
||||
m_Banner(NULL),
|
||||
m_Shown(FALSE),
|
||||
m_ShowFlags(0)
|
||||
m_ShowFlags(0),
|
||||
m_didAddRef(FALSE)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -49,7 +50,11 @@ CMenuDeskBar::~CMenuDeskBar()
|
||||
|
||||
LRESULT CMenuDeskBar::_OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
|
||||
{
|
||||
this->AddRef();
|
||||
if (!m_didAddRef)
|
||||
{
|
||||
this->AddRef();
|
||||
m_didAddRef = TRUE;
|
||||
}
|
||||
|
||||
bHandled = FALSE;
|
||||
return 0;
|
||||
@@ -57,6 +62,11 @@ LRESULT CMenuDeskBar::_OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &b
|
||||
|
||||
void CMenuDeskBar::OnFinalMessage(HWND /* hWnd */)
|
||||
{
|
||||
if (m_didAddRef)
|
||||
{
|
||||
this->Release();
|
||||
m_didAddRef = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CMenuDeskBar::Initialize(THIS)
|
||||
|
||||
Reference in New Issue
Block a user