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
4cafd76f
Commit
4cafd76f
authored
Jun 26, 2008
by
Joris Huizer
Committed by
Alexandre Julliard
Jun 27, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdiplus: font: Ensure to release resources.
parent
d54c53a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
font.c
dlls/gdiplus/font.c
+6
-2
No files found.
dlls/gdiplus/font.c
View file @
4cafd76f
...
...
@@ -42,6 +42,7 @@ static inline REAL get_dpi (void)
HDC
hdc
=
GetDC
(
0
);
GdipCreateFromHDC
(
hdc
,
&
graphics
);
GdipGetDpiX
(
graphics
,
&
dpi
);
GdipDeleteGraphics
(
graphics
);
ReleaseDC
(
0
,
hdc
);
return
dpi
;
...
...
@@ -351,7 +352,7 @@ GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name,
{
GpFontFamily
*
ffamily
;
HDC
hdc
;
HFONT
hFont
;
HFONT
hFont
,
hfont_old
;
LOGFONTW
lfw
;
TRACE
(
"%s, %p %p
\n
"
,
debugstr_w
(
name
),
fontCollection
,
FontFamily
);
...
...
@@ -371,14 +372,17 @@ GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name,
hdc
=
GetDC
(
0
);
lstrcpynW
(
lfw
.
lfFaceName
,
name
,
sizeof
(
WCHAR
)
*
LF_FACESIZE
);
hFont
=
CreateFontIndirectW
(
&
lfw
);
SelectObject
(
hdc
,
hFont
);
hfont_old
=
SelectObject
(
hdc
,
hFont
);
GetTextMetricsW
(
hdc
,
ffamily
->
tmw
);
DeleteObject
(
SelectObject
(
hdc
,
hfont_old
));
ffamily
->
FamilyName
=
GdipAlloc
(
LF_FACESIZE
*
sizeof
(
WCHAR
));
if
(
!
ffamily
->
FamilyName
)
{
GdipFree
(
ffamily
->
tmw
);
GdipFree
(
ffamily
);
ReleaseDC
(
0
,
hdc
);
return
OutOfMemory
;
}
...
...
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