mirror of
https://github.com/reactos/reactos.git
synced 2025-07-29 15:52:19 +00:00
[EXPLORER] WatchList should be freed with delete[], not delete (#374)
WatchList is a set of array objects, initialized with "new[]", so it should be freed with "delete[]" to free all of its elements. Otherwise using only "delete" only frees the first variable but not its array. This would lead to an undefined behaviour.
This commit is contained in:
parent
075d58cc64
commit
abdde0b764
1 changed files with 2 additions and 2 deletions
|
@ -413,7 +413,7 @@ UINT WINAPI CIconWatcher::WatcherThread(_In_opt_ LPVOID lpParam)
|
|||
ASSERT(Size <= MAXIMUM_WAIT_OBJECTS);
|
||||
|
||||
if (WatchList)
|
||||
delete WatchList;
|
||||
delete[] WatchList;
|
||||
WatchList = new HANDLE[Size];
|
||||
WatchList[0] = This->m_WakeUpEvent;
|
||||
|
||||
|
@ -479,7 +479,7 @@ UINT WINAPI CIconWatcher::WatcherThread(_In_opt_ LPVOID lpParam)
|
|||
}
|
||||
|
||||
if (WatchList)
|
||||
delete WatchList;
|
||||
delete[] WatchList;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue