Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
95f8371a
Commit
95f8371a
authored
Jun 03, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Use a simplified sequence to destroy windows at thread exit, since we…
user32: Use a simplified sequence to destroy windows at thread exit, since we don't want to send messages.
parent
5dcf157b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
4 deletions
+78
-4
win.c
dlls/user32/win.c
+78
-4
No files found.
dlls/user32/win.c
View file @
95f8371a
...
...
@@ -712,6 +712,75 @@ LRESULT WIN_DestroyWindow( HWND hwnd )
return
0
;
}
/***********************************************************************
* destroy_thread_window
*
* Destroy a window upon exit of its thread.
*/
static
void
destroy_thread_window
(
HWND
hwnd
)
{
WND
*
wndPtr
;
HWND
*
list
;
HMENU
menu
=
0
,
sys_menu
=
0
;
WORD
index
;
/* free child windows */
if
((
list
=
WIN_ListChildren
(
hwnd
)))
{
int
i
;
for
(
i
=
0
;
list
[
i
];
i
++
)
{
if
(
WIN_IsCurrentThread
(
list
[
i
]
))
destroy_thread_window
(
list
[
i
]
);
else
SendMessageW
(
list
[
i
],
WM_WINE_DESTROYWINDOW
,
0
,
0
);
}
HeapFree
(
GetProcessHeap
(),
0
,
list
);
}
/* destroy the client-side storage */
index
=
USER_HANDLE_TO_INDEX
(
hwnd
);
if
(
index
>=
NB_USER_HANDLES
)
return
;
USER_Lock
();
if
((
wndPtr
=
user_handles
[
index
]))
{
if
((
wndPtr
->
dwStyle
&
(
WS_CHILD
|
WS_POPUP
))
!=
WS_CHILD
)
menu
=
(
HMENU
)
wndPtr
->
wIDmenu
;
sys_menu
=
wndPtr
->
hSysMenu
;
free_dce
(
wndPtr
->
dce
,
hwnd
);
user_handles
[
index
]
=
NULL
;
wndPtr
->
dwMagic
=
0
;
}
USER_Unlock
();
HeapFree
(
GetProcessHeap
(),
0
,
wndPtr
);
if
(
menu
)
DestroyMenu
(
menu
);
if
(
sys_menu
)
DestroyMenu
(
sys_menu
);
}
/***********************************************************************
* destroy_thread_child_windows
*
* Destroy child windows upon exit of its thread.
*/
static
void
destroy_thread_child_windows
(
HWND
hwnd
)
{
HWND
*
list
;
int
i
;
if
(
WIN_IsCurrentThread
(
hwnd
))
{
destroy_thread_window
(
hwnd
);
}
else
if
((
list
=
WIN_ListChildren
(
hwnd
)))
{
for
(
i
=
0
;
list
[
i
];
i
++
)
destroy_thread_child_windows
(
list
[
i
]
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
}
}
/***********************************************************************
* WIN_DestroyThreadWindows
*
...
...
@@ -723,13 +792,18 @@ void WIN_DestroyThreadWindows( HWND hwnd )
int
i
;
if
(
!
(
list
=
WIN_ListChildren
(
hwnd
)))
return
;
/* reset owners of top-level windows */
for
(
i
=
0
;
list
[
i
];
i
++
)
{
if
(
WIN_IsCurrentThread
(
list
[
i
]
))
DestroyWindow
(
list
[
i
]
);
else
WIN_DestroyThreadWindows
(
list
[
i
]
);
if
(
!
WIN_IsCurrentThread
(
list
[
i
]
))
{
HWND
owner
=
GetWindow
(
list
[
i
],
GW_OWNER
);
if
(
owner
&&
WIN_IsCurrentThread
(
owner
))
WIN_SetOwner
(
list
[
i
],
0
);
}
}
for
(
i
=
0
;
list
[
i
];
i
++
)
destroy_thread_child_windows
(
list
[
i
]
);
HeapFree
(
GetProcessHeap
(),
0
,
list
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment