mirror of
https://github.com/reactos/reactos.git
synced 2025-01-01 03:54:02 +00:00
- Properly remove window properties when destroying the window.
svn path=/trunk/; revision=60684
This commit is contained in:
parent
512ac8d32c
commit
1a21c35d02
3 changed files with 26 additions and 9 deletions
|
@ -16,12 +16,12 @@ IntGetProp(PWND Window, ATOM Atom)
|
|||
{
|
||||
PLIST_ENTRY ListEntry;
|
||||
PPROPERTY Property;
|
||||
int i;
|
||||
|
||||
ListEntry = Window->PropListHead.Flink;
|
||||
while (ListEntry != &Window->PropListHead)
|
||||
for (i = 0; i < Window->PropListItems; i++ )
|
||||
{
|
||||
Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
|
||||
if (!Property) break;
|
||||
if (Property->Atom == Atom)
|
||||
{
|
||||
return(Property);
|
||||
|
@ -79,6 +79,25 @@ IntSetProp(PWND pWnd, ATOM Atom, HANDLE Data)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
VOID FASTCALL
|
||||
IntRemoveWindowProp(PWND Window)
|
||||
{
|
||||
PLIST_ENTRY ListEntry;
|
||||
PPROPERTY Property;
|
||||
int i, Count = Window->PropListItems;
|
||||
|
||||
ListEntry = Window->PropListHead.Flink;
|
||||
for (i = 0; i < Count; i++ )
|
||||
{
|
||||
Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
|
||||
ListEntry = ListEntry->Flink;
|
||||
RemoveEntryList(&Property->PropListEntry);
|
||||
UserHeapFree(Property);
|
||||
Window->PropListItems--;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
NTSTATUS APIENTRY
|
||||
|
|
|
@ -4,3 +4,4 @@ PPROPERTY FASTCALL IntGetProp(PWND,ATOM);
|
|||
BOOL FASTCALL IntRemoveProp(PWND,ATOM);
|
||||
BOOL FASTCALL IntSetProp(PWND, ATOM, HANDLE);
|
||||
HANDLE FASTCALL UserGetProp(PWND, ATOM);
|
||||
VOID FASTCALL IntRemoveWindowProp(PWND Window);
|
||||
|
|
|
@ -426,8 +426,6 @@ static LRESULT co_UserFreeWindow(PWND Window,
|
|||
PWND Child;
|
||||
PMENU_OBJECT Menu;
|
||||
BOOLEAN BelongsToThreadData;
|
||||
PLIST_ENTRY ListEntry;
|
||||
PPROPERTY Property;
|
||||
|
||||
ASSERT(Window);
|
||||
|
||||
|
@ -556,12 +554,11 @@ static LRESULT co_UserFreeWindow(PWND Window,
|
|||
|
||||
IntUnlinkWindow(Window);
|
||||
|
||||
ListEntry = Window->PropListHead.Flink;
|
||||
while (ListEntry != &Window->PropListHead)
|
||||
if (Window->PropListItems)
|
||||
{
|
||||
Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
|
||||
ListEntry = ListEntry->Flink;
|
||||
IntRemoveProp(Window, Property->Atom);
|
||||
IntRemoveWindowProp(Window);
|
||||
TRACE("Window->PropListItems %d\n",Window->PropListItems);
|
||||
ASSERT(Window->PropListItems==0);
|
||||
}
|
||||
|
||||
UserReferenceObject(Window);
|
||||
|
|
Loading…
Reference in a new issue