Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
72ec1c18
Commit
72ec1c18
authored
Feb 10, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Feb 10, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Use a single lock in destroy_thread_windows.
Signed-off-by:
Jacek Caban
<
jacek@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b31225da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
19 deletions
+21
-19
win.c
dlls/user32/win.c
+21
-19
No files found.
dlls/user32/win.c
View file @
72ec1c18
...
...
@@ -1185,7 +1185,6 @@ static WND *next_thread_window( HWND *hwnd )
WND
*
win
;
WORD
index
=
*
hwnd
?
USER_HANDLE_TO_INDEX
(
*
hwnd
)
+
1
:
0
;
USER_Lock
();
while
(
index
<
NB_USER_HANDLES
)
{
if
(
!
(
ptr
=
user_handles
[
index
++
]))
continue
;
...
...
@@ -1195,7 +1194,6 @@ static WND *next_thread_window( HWND *hwnd )
*
hwnd
=
ptr
->
handle
;
return
win
;
}
USER_Unlock
();
return
NULL
;
}
...
...
@@ -1207,29 +1205,33 @@ static WND *next_thread_window( HWND *hwnd )
*/
void
destroy_thread_windows
(
void
)
{
WND
*
w
ndPtr
;
WND
*
w
in
,
*
free_list
=
NULL
,
**
free_list_ptr
=
&
free_list
;
HWND
hwnd
=
0
;
HMENU
menu
,
sys_menu
;
struct
window_surface
*
surface
;
while
((
wndPtr
=
next_thread_window
(
&
hwnd
)))
USER_Lock
();
while
((
win
=
next_thread_window
(
&
hwnd
)))
{
free_dce
(
win
->
dce
,
win
->
obj
.
handle
);
InterlockedCompareExchangePointer
(
&
user_handles
[
USER_HANDLE_TO_INDEX
(
hwnd
)],
NULL
,
win
);
win
->
obj
.
handle
=
*
free_list_ptr
;
free_list_ptr
=
(
WND
**
)
&
win
->
obj
.
handle
;
}
USER_Unlock
();
while
((
win
=
free_list
))
{
/* destroy the client-side storage */
free_list
=
win
->
obj
.
handle
;
TRACE
(
"destroying %p
\n
"
,
win
);
menu
=
((
wndPtr
->
dwStyle
&
(
WS_CHILD
|
WS_POPUP
))
!=
WS_CHILD
)
?
(
HMENU
)
wndPtr
->
wIDmenu
:
0
;
sys_menu
=
wndPtr
->
hSysMenu
;
free_dce
(
wndPtr
->
dce
,
hwnd
);
surface
=
wndPtr
->
surface
;
InterlockedCompareExchangePointer
(
&
user_handles
[
USER_HANDLE_TO_INDEX
(
hwnd
)],
NULL
,
wndPtr
);
WIN_ReleasePtr
(
wndPtr
);
HeapFree
(
GetProcessHeap
(),
0
,
wndPtr
);
if
(
menu
)
DestroyMenu
(
menu
);
if
(
sys_menu
)
DestroyMenu
(
sys_menu
);
if
(
surface
)
if
((
win
->
dwStyle
&
(
WS_CHILD
|
WS_POPUP
))
!=
WS_CHILD
&&
win
->
wIDmenu
)
DestroyMenu
(
UlongToHandle
(
win
->
wIDmenu
)
);
if
(
win
->
hSysMenu
)
DestroyMenu
(
win
->
hSysMenu
);
if
(
win
->
surface
)
{
register_window_surface
(
surface
,
NULL
);
window_surface_release
(
surface
);
register_window_surface
(
win
->
surface
,
NULL
);
window_surface_release
(
win
->
surface
);
}
HeapFree
(
GetProcessHeap
(),
0
,
win
);
}
}
...
...
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