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
4293b614
Commit
4293b614
authored
Mar 14, 2005
by
Peter Berg Larsen
Committed by
Alexandre Julliard
Mar 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Assorted memleak fixes. Found on Michael Stefaniuc smatch list.
parent
2444f4af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
15 deletions
+25
-15
clipboard.c
dlls/x11drv/clipboard.c
+14
-5
xrender.c
dlls/x11drv/xrender.c
+11
-10
No files found.
dlls/x11drv/clipboard.c
View file @
4293b614
...
...
@@ -1262,13 +1262,17 @@ HANDLE X11DRV_CLIPBOARD_ImportClipboardData(LPBYTE lpdata, UINT cBytes)
{
/* Turn on the DDESHARE flag to enable shared 32 bit memory */
hClipData
=
GlobalAlloc
(
GMEM_MOVEABLE
|
GMEM_DDESHARE
,
cBytes
);
if
(
hClipData
==
0
)
return
NULL
;
if
((
lpClipData
=
GlobalLock
(
hClipData
)))
{
memcpy
(
lpClipData
,
lpdata
,
cBytes
);
GlobalUnlock
(
hClipData
);
}
else
else
{
GlobalFree
(
hClipData
);
hClipData
=
0
;
}
}
return
hClipData
;
...
...
@@ -1296,6 +1300,7 @@ HANDLE X11DRV_CLIPBOARD_ExportClipboardData(Window requestor, Atom aTarget,
cBytes
=
GlobalSize
(
lpData
->
hData32
);
hClipData
=
GlobalAlloc
(
GMEM_MOVEABLE
|
GMEM_DDESHARE
,
cBytes
);
if
(
hClipData
==
0
)
return
NULL
;
if
((
lpClipData
=
GlobalLock
(
hClipData
)))
{
...
...
@@ -1306,6 +1311,9 @@ HANDLE X11DRV_CLIPBOARD_ExportClipboardData(Window requestor, Atom aTarget,
GlobalUnlock
(
lpData
->
hData32
);
GlobalUnlock
(
hClipData
);
}
else
{
GlobalFree
(
hClipData
);
hClipData
=
0
;
}
}
...
...
@@ -1324,7 +1332,7 @@ HANDLE X11DRV_CLIPBOARD_ExportXAString(LPWINE_CLIPDATA lpData, LPDWORD lpBytes)
UINT
i
,
j
;
UINT
size
;
LPWSTR
uni_text
;
LPSTR
text
,
lpstr
;
LPSTR
text
,
lpstr
=
NULL
;
*
lpBytes
=
0
;
/* Assume return has zero bytes */
...
...
@@ -1333,14 +1341,14 @@ HANDLE X11DRV_CLIPBOARD_ExportXAString(LPWINE_CLIPDATA lpData, LPDWORD lpBytes)
size
=
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
uni_text
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
text
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
if
(
!
text
)
return
None
;
if
(
!
text
)
goto
done
;
WideCharToMultiByte
(
CP_UNIXCP
,
0
,
uni_text
,
-
1
,
text
,
size
,
NULL
,
NULL
);
/* remove carriage returns */
lpstr
=
(
char
*
)
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
size
--
);
if
(
lpstr
==
NULL
)
return
None
;
if
(
lpstr
==
NULL
)
goto
done
;
for
(
i
=
0
,
j
=
0
;
i
<
size
&&
text
[
i
];
i
++
)
{
if
(
text
[
i
]
==
'\r'
&&
...
...
@@ -1351,6 +1359,7 @@ HANDLE X11DRV_CLIPBOARD_ExportXAString(LPWINE_CLIPDATA lpData, LPDWORD lpBytes)
*
lpBytes
=
j
;
/* Number of bytes in string */
done:
HeapFree
(
GetProcessHeap
(),
0
,
text
);
GlobalUnlock
(
lpData
->
hData32
);
...
...
dlls/x11drv/xrender.c
View file @
4293b614
...
...
@@ -1065,13 +1065,13 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
if
(
flags
&
(
ETO_CLIPPED
|
ETO_OPAQUE
))
{
if
(
!
lprect
)
{
if
(
flags
&
ETO_CLIPPED
)
return
FALSE
;
GetTextExtentPointI
(
hdc
,
glyphs
,
count
,
&
sz
);
done_extents
=
TRUE
;
rc
.
left
=
x
;
rc
.
top
=
y
;
rc
.
right
=
x
+
sz
.
cx
;
rc
.
bottom
=
y
+
sz
.
cy
;
if
(
flags
&
ETO_CLIPPED
)
goto
done
;
GetTextExtentPointI
(
hdc
,
glyphs
,
count
,
&
sz
);
done_extents
=
TRUE
;
rc
.
left
=
x
;
rc
.
top
=
y
;
rc
.
right
=
x
+
sz
.
cx
;
rc
.
bottom
=
y
+
sz
.
cy
;
}
else
{
rc
=
*
lprect
;
}
...
...
@@ -1115,7 +1115,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
if
(
count
==
0
)
{
retv
=
TRUE
;
goto
done
;
goto
done
_unlock
;
}
pt
.
x
=
x
;
...
...
@@ -1539,7 +1539,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
strikeoutWidth
=
underlineWidth
;
}
else
{
otm
=
HeapAlloc
(
GetProcessHeap
(),
0
,
nMetricsSize
);
if
(
!
otm
)
goto
done
;
if
(
!
otm
)
goto
done
_unlock
;
GetOutlineTextMetricsW
(
hdc
,
nMetricsSize
,
otm
);
underlinePos
=
otm
->
otmsUnderscorePosition
;
...
...
@@ -1592,8 +1592,9 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
retv
=
TRUE
;
done:
done
_unlock
:
X11DRV_UnlockDIBSection
(
physDev
,
TRUE
);
done:
if
(
glyphs
!=
wstr
)
HeapFree
(
GetProcessHeap
(),
0
,
(
WORD
*
)
glyphs
);
return
retv
;
}
...
...
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