mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[SHELL32] Follow-up of 'Simplify CChangeNotifyServer'
Do DestroyAllItems() on OnDestroy(). CORE-13950
This commit is contained in:
parent
08bd879247
commit
c5f6e744e7
1 changed files with 16 additions and 0 deletions
|
@ -79,6 +79,7 @@ private:
|
||||||
BOOL RemoveItemsByRegID(UINT nRegID);
|
BOOL RemoveItemsByRegID(UINT nRegID);
|
||||||
BOOL RemoveItemsByProcess(DWORD dwUserPID);
|
BOOL RemoveItemsByProcess(DWORD dwUserPID);
|
||||||
void DestroyItem(CWatchItem *pItem, HWND *phwndBroker);
|
void DestroyItem(CWatchItem *pItem, HWND *phwndBroker);
|
||||||
|
void DestroyAllItems();
|
||||||
|
|
||||||
UINT GetNextRegID();
|
UINT GetNextRegID();
|
||||||
BOOL DeliverNotification(HANDLE hTicket, DWORD dwOwnerPID);
|
BOOL DeliverNotification(HANDLE hTicket, DWORD dwOwnerPID);
|
||||||
|
@ -136,6 +137,20 @@ void CChangeNotifyServer::DestroyItem(CWatchItem *pItem, HWND *phwndBroker)
|
||||||
delete pItem;
|
delete pItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CChangeNotifyServer::DestroyAllItems()
|
||||||
|
{
|
||||||
|
for (INT i = 0; i < m_items.GetSize(); ++i)
|
||||||
|
{
|
||||||
|
if (m_items[i])
|
||||||
|
{
|
||||||
|
HWND hwndBroker = NULL;
|
||||||
|
DestroyItem(m_items[i], &hwndBroker);
|
||||||
|
m_items[i] = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
m_items.RemoveAll();
|
||||||
|
}
|
||||||
|
|
||||||
BOOL CChangeNotifyServer::RemoveItemsByRegID(UINT nRegID)
|
BOOL CChangeNotifyServer::RemoveItemsByRegID(UINT nRegID)
|
||||||
{
|
{
|
||||||
BOOL bFound = FALSE;
|
BOOL bFound = FALSE;
|
||||||
|
@ -319,6 +334,7 @@ LRESULT CChangeNotifyServer::OnRemoveByPID(UINT uMsg, WPARAM wParam, LPARAM lPar
|
||||||
|
|
||||||
LRESULT CChangeNotifyServer::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
LRESULT CChangeNotifyServer::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||||
{
|
{
|
||||||
|
DestroyAllItems();
|
||||||
CDirectoryWatcher::RequestAllWatchersTermination();
|
CDirectoryWatcher::RequestAllWatchersTermination();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue