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
e015928a
Commit
e015928a
authored
Apr 21, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
uxtheme: Fix buffer bitmap leak.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
a86af722
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
buffer.c
dlls/uxtheme/buffer.c
+7
-5
No files found.
dlls/uxtheme/buffer.c
View file @
e015928a
...
...
@@ -39,12 +39,14 @@ struct paintbuffer
{
HDC
targetdc
;
HDC
memorydc
;
HBITMAP
bitmap
;
RECT
rect
;
void
*
bits
;
};
static
void
free_paintbuffer
(
struct
paintbuffer
*
buffer
)
{
DeleteObject
(
buffer
->
bitmap
);
DeleteDC
(
buffer
->
memorydc
);
HeapFree
(
GetProcessHeap
(),
0
,
buffer
);
}
...
...
@@ -83,7 +85,6 @@ HPAINTBUFFER WINAPI BeginBufferedPaint(HDC targetdc, const RECT *rect,
char
bmibuf
[
FIELD_OFFSET
(
BITMAPINFO
,
bmiColors
[
256
])];
BITMAPINFO
*
bmi
=
(
BITMAPINFO
*
)
bmibuf
;
struct
paintbuffer
*
buffer
;
HBITMAP
hbm
;
TRACE
(
"(%p %s %d %p %p)
\n
"
,
targetdc
,
wine_dbgstr_rect
(
rect
),
format
,
params
,
retdc
);
...
...
@@ -105,7 +106,7 @@ HPAINTBUFFER WINAPI BeginBufferedPaint(HDC targetdc, const RECT *rect,
switch
(
format
)
{
case
BPBF_COMPATIBLEBITMAP
:
hbm
=
CreateCompatibleBitmap
(
targetdc
,
rect
->
right
-
rect
->
left
,
rect
->
bottom
-
rect
->
top
);
buffer
->
bitmap
=
CreateCompatibleBitmap
(
targetdc
,
rect
->
right
-
rect
->
left
,
rect
->
bottom
-
rect
->
top
);
buffer
->
bits
=
NULL
;
break
;
case
BPBF_DIB
:
...
...
@@ -120,22 +121,23 @@ HPAINTBUFFER WINAPI BeginBufferedPaint(HDC targetdc, const RECT *rect,
bmi
->
bmiHeader
.
biBitCount
=
format
==
BPBF_TOPDOWNMONODIB
?
1
:
32
;
bmi
->
bmiHeader
.
biPlanes
=
1
;
bmi
->
bmiHeader
.
biCompression
=
BI_RGB
;
hbm
=
CreateDIBSection
(
buffer
->
memorydc
,
bmi
,
DIB_RGB_COLORS
,
&
buffer
->
bits
,
NULL
,
0
);
buffer
->
bitmap
=
CreateDIBSection
(
buffer
->
memorydc
,
bmi
,
DIB_RGB_COLORS
,
&
buffer
->
bits
,
NULL
,
0
);
break
;
default:
WARN
(
"Unknown buffer format %d
\n
"
,
format
);
buffer
->
bitmap
=
NULL
;
free_paintbuffer
(
buffer
);
return
NULL
;
}
if
(
!
hbm
)
if
(
!
buffer
->
bitmap
)
{
WARN
(
"Failed to create buffer bitmap
\n
"
);
free_paintbuffer
(
buffer
);
return
NULL
;
}
DeleteObject
(
SelectObject
(
buffer
->
memorydc
,
hbm
));
DeleteObject
(
SelectObject
(
buffer
->
memorydc
,
buffer
->
bitmap
));
*
retdc
=
buffer
->
memorydc
;
...
...
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