mirror of
https://github.com/reactos/reactos.git
synced 2025-01-03 21:09:19 +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;
|
PLIST_ENTRY ListEntry;
|
||||||
PPROPERTY Property;
|
PPROPERTY Property;
|
||||||
|
int i;
|
||||||
|
|
||||||
ListEntry = Window->PropListHead.Flink;
|
ListEntry = Window->PropListHead.Flink;
|
||||||
while (ListEntry != &Window->PropListHead)
|
for (i = 0; i < Window->PropListItems; i++ )
|
||||||
{
|
{
|
||||||
Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
|
Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
|
||||||
if (!Property) break;
|
|
||||||
if (Property->Atom == Atom)
|
if (Property->Atom == Atom)
|
||||||
{
|
{
|
||||||
return(Property);
|
return(Property);
|
||||||
|
@ -79,6 +79,25 @@ IntSetProp(PWND pWnd, ATOM Atom, HANDLE Data)
|
||||||
return TRUE;
|
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 *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
NTSTATUS APIENTRY
|
NTSTATUS APIENTRY
|
||||||
|
|
|
@ -4,3 +4,4 @@ PPROPERTY FASTCALL IntGetProp(PWND,ATOM);
|
||||||
BOOL FASTCALL IntRemoveProp(PWND,ATOM);
|
BOOL FASTCALL IntRemoveProp(PWND,ATOM);
|
||||||
BOOL FASTCALL IntSetProp(PWND, ATOM, HANDLE);
|
BOOL FASTCALL IntSetProp(PWND, ATOM, HANDLE);
|
||||||
HANDLE FASTCALL UserGetProp(PWND, ATOM);
|
HANDLE FASTCALL UserGetProp(PWND, ATOM);
|
||||||
|
VOID FASTCALL IntRemoveWindowProp(PWND Window);
|
||||||
|
|
|
@ -426,8 +426,6 @@ static LRESULT co_UserFreeWindow(PWND Window,
|
||||||
PWND Child;
|
PWND Child;
|
||||||
PMENU_OBJECT Menu;
|
PMENU_OBJECT Menu;
|
||||||
BOOLEAN BelongsToThreadData;
|
BOOLEAN BelongsToThreadData;
|
||||||
PLIST_ENTRY ListEntry;
|
|
||||||
PPROPERTY Property;
|
|
||||||
|
|
||||||
ASSERT(Window);
|
ASSERT(Window);
|
||||||
|
|
||||||
|
@ -556,12 +554,11 @@ static LRESULT co_UserFreeWindow(PWND Window,
|
||||||
|
|
||||||
IntUnlinkWindow(Window);
|
IntUnlinkWindow(Window);
|
||||||
|
|
||||||
ListEntry = Window->PropListHead.Flink;
|
if (Window->PropListItems)
|
||||||
while (ListEntry != &Window->PropListHead)
|
|
||||||
{
|
{
|
||||||
Property = CONTAINING_RECORD(ListEntry, PROPERTY, PropListEntry);
|
IntRemoveWindowProp(Window);
|
||||||
ListEntry = ListEntry->Flink;
|
TRACE("Window->PropListItems %d\n",Window->PropListItems);
|
||||||
IntRemoveProp(Window, Property->Atom);
|
ASSERT(Window->PropListItems==0);
|
||||||
}
|
}
|
||||||
|
|
||||||
UserReferenceObject(Window);
|
UserReferenceObject(Window);
|
||||||
|
|
Loading…
Reference in a new issue