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
d341b0c3
Commit
d341b0c3
authored
May 21, 2016
by
Alexandre Julliard
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Completely free owned DCEs when the corresponding window/class is destroyed.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
5f7e4ce6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
dc.c
dlls/gdi32/tests/dc.c
+0
-1
painting.c
dlls/user32/painting.c
+12
-4
No files found.
dlls/gdi32/tests/dc.c
View file @
d341b0c3
...
...
@@ -812,7 +812,6 @@ static void test_DeleteDC(void)
ok
(
ret
,
"UnregisterClassA failed
\n
"
);
ret
=
GetObjectType
(
hdc_test
);
todo_wine
ok
(
!
ret
,
"GetObjectType should fail for a deleted DC
\n
"
);
/* CS_OWNDC */
...
...
dlls/user32/painting.c
View file @
d341b0c3
...
...
@@ -338,16 +338,17 @@ static struct dce *get_window_dce( HWND hwnd )
*/
void
free_dce
(
struct
dce
*
dce
,
HWND
hwnd
)
{
struct
dce
*
dce_to_free
=
NULL
;
USER_Lock
();
if
(
dce
)
{
if
(
!--
dce
->
count
)
{
/* turn it into a cache entry */
SetHookFlags
(
dce
->
hdc
,
DCHF_RESETDC
);
release_dce
(
dce
);
dce
->
flags
|=
DCX_CACHE
;
list_remove
(
&
dce
->
entry
);
dce_to_free
=
dce
;
}
else
if
(
dce
->
hwnd
==
hwnd
)
{
...
...
@@ -362,7 +363,7 @@ void free_dce( struct dce *dce, HWND hwnd )
LIST_FOR_EACH_ENTRY
(
dce
,
&
dce_list
,
struct
dce
,
entry
)
{
if
(
dce
->
hwnd
!=
hwnd
)
continue
;
if
(
!
(
dce
->
flags
&
DCX_CACHE
))
continue
;
if
(
!
(
dce
->
flags
&
DCX_CACHE
))
break
;
if
(
dce
->
count
)
WARN
(
"GetDC() without ReleaseDC() for window %p
\n
"
,
hwnd
);
dce
->
count
=
0
;
...
...
@@ -371,6 +372,13 @@ void free_dce( struct dce *dce, HWND hwnd )
}
USER_Unlock
();
if
(
dce_to_free
)
{
SetDCHook
(
dce_to_free
->
hdc
,
NULL
,
0
);
DeleteDC
(
dce_to_free
->
hdc
);
HeapFree
(
GetProcessHeap
(),
0
,
dce_to_free
);
}
}
...
...
Vitaly Lipatov
@lav
mentioned in commit
251a085f
·
Sep 03, 2020
mentioned in commit
251a085f
mentioned in commit 251a085f2ab364e90888430cedb4b480c97f286d
Toggle commit 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