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
c722f2d3
Commit
c722f2d3
authored
Jun 13, 2012
by
Henri Verbeet
Committed by
Alexandre Julliard
Jun 13, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Merge ddraw_surface_destroy() into ddraw_surface_cleanup().
parent
af8228f0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
40 deletions
+13
-40
surface.c
dlls/ddraw/surface.c
+12
-39
dsurface.c
dlls/ddraw/tests/dsurface.c
+1
-1
No files found.
dlls/ddraw/surface.c
View file @
c722f2d3
...
@@ -444,37 +444,6 @@ static ULONG WINAPI d3d_texture1_AddRef(IDirect3DTexture *iface)
...
@@ -444,37 +444,6 @@ static ULONG WINAPI d3d_texture1_AddRef(IDirect3DTexture *iface)
return
IUnknown_AddRef
(
surface
->
texture_outer
);
return
IUnknown_AddRef
(
surface
->
texture_outer
);
}
}
/*****************************************************************************
* ddraw_surface_destroy
*
* A helper function for IDirectDrawSurface7::Release
*
* Frees the surface, regardless of its refcount.
* See IDirectDrawSurface7::Release for more information
*
* Params:
* This: Surface to free
*
*****************************************************************************/
static
void
ddraw_surface_destroy
(
struct
ddraw_surface
*
This
)
{
TRACE
(
"surface %p.
\n
"
,
This
);
/* Check the iface count and give a warning */
if
(
This
->
iface_count
>
1
)
{
/* This can happen when a complex surface is destroyed,
* because the 2nd surface was addref()ed when the app
* called GetAttachedSurface
*/
WARN
(
"(%p): Destroying surface with refcounts 7: %d 4: %d 3: %d 2: %d 1: %d
\n
"
,
This
,
This
->
ref7
,
This
->
ref4
,
This
->
ref3
,
This
->
ref2
,
This
->
ref1
);
}
if
(
This
->
wined3d_surface
)
wined3d_surface_decref
(
This
->
wined3d_surface
);
}
static
void
ddraw_surface_cleanup
(
struct
ddraw_surface
*
surface
)
static
void
ddraw_surface_cleanup
(
struct
ddraw_surface
*
surface
)
{
{
struct
ddraw_surface
*
surf
;
struct
ddraw_surface
*
surf
;
...
@@ -498,20 +467,24 @@ static void ddraw_surface_cleanup(struct ddraw_surface *surface)
...
@@ -498,20 +467,24 @@ static void ddraw_surface_cleanup(struct ddraw_surface *surface)
surf
=
surface
->
complex_array
[
i
];
surf
=
surface
->
complex_array
[
i
];
surface
->
complex_array
[
i
]
=
NULL
;
surface
->
complex_array
[
i
]
=
NULL
;
while
(
surf
)
ddraw_surface_cleanup
(
surf
);
{
struct
ddraw_surface
*
destroy
=
surf
;
surf
=
surf
->
complex_array
[
0
];
/* Iterate through the "tree" */
ddraw_surface_destroy
(
destroy
);
/* Destroy it */
}
}
}
if
(
surface
->
device1
)
if
(
surface
->
device1
)
IUnknown_Release
(
&
surface
->
device1
->
IUnknown_inner
);
IUnknown_Release
(
&
surface
->
device1
->
IUnknown_inner
);
ifaceToRelease
=
surface
->
ifaceToRelease
;
ifaceToRelease
=
surface
->
ifaceToRelease
;
/* Destroy the root surface. */
if
(
surface
->
iface_count
>
1
)
ddraw_surface_destroy
(
surface
);
{
/* This can happen when a complex surface is destroyed, because the
* 2nd surface was addref()ed when the app called
* GetAttachedSurface(). */
WARN
(
"Destroying surface %p with refcounts 7: %u 4: %u 3: %u 2: %u 1: %u.
\n
"
,
surface
,
surface
->
ref7
,
surface
->
ref4
,
surface
->
ref3
,
surface
->
ref2
,
surface
->
ref1
);
}
if
(
surface
->
wined3d_surface
)
wined3d_surface_decref
(
surface
->
wined3d_surface
);
/* Reduce the ddraw refcount */
/* Reduce the ddraw refcount */
if
(
ifaceToRelease
)
if
(
ifaceToRelease
)
...
...
dlls/ddraw/tests/dsurface.c
View file @
c722f2d3
...
@@ -1958,7 +1958,7 @@ static void CubeMapTest(void)
...
@@ -1958,7 +1958,7 @@ static void CubeMapTest(void)
IDirectDrawSurface7_Release
(
cubemap
);
IDirectDrawSurface7_Release
(
cubemap
);
ref
=
getRefcount
((
IUnknown
*
)
palette
);
ref
=
getRefcount
((
IUnknown
*
)
palette
);
todo_wine
ok
(
ref
==
1
,
"Refcount is %u, expected 1
\n
"
,
ref
);
ok
(
ref
==
1
,
"Refcount is %u, expected 1
\n
"
,
ref
);
IDirectDrawPalette_Release
(
palette
);
IDirectDrawPalette_Release
(
palette
);
...
...
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