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
acbccf17
Commit
acbccf17
authored
Apr 26, 2023
by
Piotr Caban
Committed by
Alexandre Julliard
Apr 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Improve EMF DC cleanup when CloseEnhMetafile is not called.
parent
d317db91
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
emfdc.c
dlls/gdi32/emfdc.c
+7
-0
No files found.
dlls/gdi32/emfdc.c
View file @
acbccf17
...
...
@@ -2384,6 +2384,9 @@ void EMFDC_DeleteDC( DC_ATTR *dc_attr )
struct
emf
*
emf
=
get_dc_emf
(
dc_attr
);
UINT
index
;
if
(
emf
->
dc_brush
)
DeleteObject
(
emf
->
dc_brush
);
if
(
emf
->
dc_pen
)
DeleteObject
(
emf
->
dc_pen
);
CloseHandle
(
emf
->
file
);
HeapFree
(
GetProcessHeap
(),
0
,
emf
->
palette
);
HeapFree
(
GetProcessHeap
(),
0
,
emf
->
emh
);
for
(
index
=
0
;
index
<
emf
->
handles_size
;
index
++
)
...
...
@@ -2597,7 +2600,9 @@ HENHMETAFILE WINAPI CloseEnhMetaFile( HDC hdc )
RestoreDC
(
hdc
,
1
);
if
(
emf
->
dc_brush
)
DeleteObject
(
emf
->
dc_brush
);
emf
->
dc_brush
=
0
;
if
(
emf
->
dc_pen
)
DeleteObject
(
emf
->
dc_pen
);
emf
->
dc_pen
=
0
;
emr
->
emr
.
iType
=
EMR_EOF
;
...
...
@@ -2630,6 +2635,7 @@ HENHMETAFILE WINAPI CloseEnhMetaFile( HDC hdc )
if
(
!
WriteFile
(
emf
->
file
,
emf
->
emh
,
emf
->
emh
->
nBytes
,
NULL
,
NULL
))
{
CloseHandle
(
emf
->
file
);
emf
->
file
=
0
;
return
0
;
}
HeapFree
(
GetProcessHeap
(),
0
,
emf
->
emh
);
...
...
@@ -2642,6 +2648,7 @@ HENHMETAFILE WINAPI CloseEnhMetaFile( HDC hdc )
}
hmf
=
EMF_Create_HENHMETAFILE
(
emf
->
emh
,
emf
->
emh
->
nBytes
,
emf
->
file
!=
0
);
emf
->
file
=
0
;
emf
->
emh
=
NULL
;
/* So it won't be deleted */
DeleteDC
(
hdc
);
return
hmf
;
...
...
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