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
5dbd834c
Commit
5dbd834c
authored
Dec 14, 2006
by
Markus Amsler
Committed by
Alexandre Julliard
Dec 14, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Release non implicit surfaces only if refcount is 0, with test.
parent
1adf857a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
surface.c
dlls/d3d8/surface.c
+4
-2
device.c
dlls/d3d8/tests/device.c
+3
-0
No files found.
dlls/d3d8/surface.c
View file @
5dbd834c
...
@@ -72,12 +72,14 @@ static ULONG WINAPI IDirect3DSurface8Impl_Release(LPDIRECT3DSURFACE8 iface) {
...
@@ -72,12 +72,14 @@ static ULONG WINAPI IDirect3DSurface8Impl_Release(LPDIRECT3DSURFACE8 iface) {
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) : ReleaseRef to %d
\n
"
,
This
,
ref
);
TRACE
(
"(%p) : ReleaseRef to %d
\n
"
,
This
,
ref
);
if
(
ref
==
0
&&
This
->
parentDevice
)
IUnknown_Release
(
This
->
parentDevice
);
if
(
ref
==
0
)
{
if
(
This
->
parentDevice
)
IUnknown_Release
(
This
->
parentDevice
);
/* Implicit surfaces are destroyed with the device, not if refcount reaches 0. */
/* Implicit surfaces are destroyed with the device, not if refcount reaches 0. */
if
(
ref
>=
0
&&
!
This
->
isImplicit
)
{
if
(
!
This
->
isImplicit
)
{
IWineD3DSurface_Release
(
This
->
wineD3DSurface
);
IWineD3DSurface_Release
(
This
->
wineD3DSurface
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
}
}
return
ref
;
return
ref
;
}
}
...
...
dlls/d3d8/tests/device.c
View file @
5dbd834c
...
@@ -476,10 +476,13 @@ static void test_refcount(void)
...
@@ -476,10 +476,13 @@ static void test_refcount(void)
/* Surfaces */
/* Surfaces */
hr
=
IDirect3DDevice8_CreateDepthStencilSurface
(
pDevice
,
32
,
32
,
D3DFMT_D24S8
,
D3DMULTISAMPLE_NONE
,
&
pStencilSurface
);
hr
=
IDirect3DDevice8_CreateDepthStencilSurface
(
pDevice
,
32
,
32
,
D3DFMT_D24S8
,
D3DMULTISAMPLE_NONE
,
&
pStencilSurface
);
CHECK_CALL
(
hr
,
"CreateDepthStencilSurface"
,
pDevice
,
++
refcount
);
CHECK_CALL
(
hr
,
"CreateDepthStencilSurface"
,
pDevice
,
++
refcount
);
CHECK_REFCOUNT
(
pStencilSurface
,
1
);
hr
=
IDirect3DDevice8_CreateImageSurface
(
pDevice
,
32
,
32
,
D3DFMT_X8R8G8B8
,
&
pImageSurface
);
hr
=
IDirect3DDevice8_CreateImageSurface
(
pDevice
,
32
,
32
,
D3DFMT_X8R8G8B8
,
&
pImageSurface
);
CHECK_CALL
(
hr
,
"CreateImageSurface"
,
pDevice
,
++
refcount
);
CHECK_CALL
(
hr
,
"CreateImageSurface"
,
pDevice
,
++
refcount
);
CHECK_REFCOUNT
(
pImageSurface
,
1
);
hr
=
IDirect3DDevice8_CreateRenderTarget
(
pDevice
,
32
,
32
,
D3DFMT_X8R8G8B8
,
D3DMULTISAMPLE_NONE
,
TRUE
,
&
pRenderTarget3
);
hr
=
IDirect3DDevice8_CreateRenderTarget
(
pDevice
,
32
,
32
,
D3DFMT_X8R8G8B8
,
D3DMULTISAMPLE_NONE
,
TRUE
,
&
pRenderTarget3
);
CHECK_CALL
(
hr
,
"CreateRenderTarget"
,
pDevice
,
++
refcount
);
CHECK_CALL
(
hr
,
"CreateRenderTarget"
,
pDevice
,
++
refcount
);
CHECK_REFCOUNT
(
pRenderTarget3
,
1
);
/* Misc */
/* Misc */
hr
=
IDirect3DDevice8_CreateStateBlock
(
pDevice
,
D3DSBT_ALL
,
&
dStateBlock
);
hr
=
IDirect3DDevice8_CreateStateBlock
(
pDevice
,
D3DSBT_ALL
,
&
dStateBlock
);
CHECK_CALL
(
hr
,
"CreateStateBlock"
,
pDevice
,
refcount
);
CHECK_CALL
(
hr
,
"CreateStateBlock"
,
pDevice
,
refcount
);
...
...
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