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
7caa61fd
Commit
7caa61fd
authored
Nov 15, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/imagelist: Make ImageList_Destroy just decrease refcount. Move actual…
comctl32/imagelist: Make ImageList_Destroy just decrease refcount. Move actual destruction to ::Release.
parent
4afc5454
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
20 deletions
+44
-20
imagelist.c
dlls/comctl32/imagelist.c
+15
-19
imagelist.c
dlls/comctl32/tests/imagelist.c
+29
-1
No files found.
dlls/comctl32/imagelist.c
View file @
7caa61fd
...
...
@@ -692,25 +692,6 @@ ImageList_Destroy (HIMAGELIST himl)
if
(
!
is_valid
(
himl
))
return
FALSE
;
/* delete image bitmaps */
if
(
himl
->
hbmImage
)
DeleteObject
(
himl
->
hbmImage
);
if
(
himl
->
hbmMask
)
DeleteObject
(
himl
->
hbmMask
);
/* delete image & mask DCs */
if
(
himl
->
hdcImage
)
DeleteDC
(
himl
->
hdcImage
);
if
(
himl
->
hdcMask
)
DeleteDC
(
himl
->
hdcMask
);
/* delete blending brushes */
if
(
himl
->
hbrBlend25
)
DeleteObject
(
himl
->
hbrBlend25
);
if
(
himl
->
hbrBlend50
)
DeleteObject
(
himl
->
hbrBlend50
);
/* Free the IImageList instance */
IImageList_Release
((
IImageList
*
)
himl
);
return
TRUE
;
}
...
...
@@ -2972,7 +2953,22 @@ static ULONG WINAPI ImageListImpl_Release(IImageList *iface)
TRACE
(
"(%p) refcount=%u
\n
"
,
iface
,
ref
);
if
(
ref
==
0
)
{
/* delete image bitmaps */
if
(
This
->
hbmImage
)
DeleteObject
(
This
->
hbmImage
);
if
(
This
->
hbmMask
)
DeleteObject
(
This
->
hbmMask
);
/* delete image & mask DCs */
if
(
This
->
hdcImage
)
DeleteDC
(
This
->
hdcImage
);
if
(
This
->
hdcMask
)
DeleteDC
(
This
->
hdcMask
);
/* delete blending brushes */
if
(
This
->
hbrBlend25
)
DeleteObject
(
This
->
hbrBlend25
);
if
(
This
->
hbrBlend50
)
DeleteObject
(
This
->
hbrBlend50
);
This
->
lpVtbl
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
}
...
...
dlls/comctl32/tests/imagelist.c
View file @
7caa61fd
...
...
@@ -1251,8 +1251,36 @@ static void test_iimagelist(void)
IImageList
*
imgl
;
HIMAGELIST
himl
;
HRESULT
hr
;
ULONG
ret
;
if
(
!
pImageList_CoCreateInstance
||
!
pHIMAGELIST_QueryInterface
)
if
(
!
pHIMAGELIST_QueryInterface
)
{
win_skip
(
"XP imagelist functions not available
\n
"
);
return
;
}
/* test reference counting on destruction */
imgl
=
(
IImageList
*
)
createImageList
(
32
,
32
);
ret
=
IUnknown_AddRef
(
imgl
);
ok
(
ret
==
2
,
"Expected 2, got %d
\n
"
,
ret
);
ret
=
ImageList_Destroy
((
HIMAGELIST
)
imgl
);
ok
(
ret
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
ret
);
ret
=
ImageList_Destroy
((
HIMAGELIST
)
imgl
);
ok
(
ret
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
ret
);
ret
=
ImageList_Destroy
((
HIMAGELIST
)
imgl
);
ok
(
ret
==
FALSE
,
"Expected FALSE, got %d
\n
"
,
ret
);
imgl
=
(
IImageList
*
)
createImageList
(
32
,
32
);
ret
=
IUnknown_AddRef
(
imgl
);
ok
(
ret
==
2
,
"Expected 2, got %d
\n
"
,
ret
);
ret
=
ImageList_Destroy
((
HIMAGELIST
)
imgl
);
ok
(
ret
==
TRUE
,
"Expected TRUE, got %d
\n
"
,
ret
);
ret
=
IImageList_Release
(
imgl
);
ok
(
ret
==
0
,
"Expected 0, got %d
\n
"
,
ret
);
ret
=
ImageList_Destroy
((
HIMAGELIST
)
imgl
);
ok
(
ret
==
FALSE
,
"Expected FALSE, got %d
\n
"
,
ret
);
if
(
!
pImageList_CoCreateInstance
)
{
win_skip
(
"Vista imagelist functions not available
\n
"
);
return
;
...
...
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