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
00927984
Commit
00927984
authored
Mar 21, 2019
by
Matteo Bruni
Committed by
Alexandre Julliard
Mar 21, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Simplify effect cleanup.
Signed-off-by:
Matteo Bruni
<
mbruni@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
479c3007
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
29 deletions
+10
-29
effect.c
dlls/d3dx9_36/effect.c
+10
-29
No files found.
dlls/d3dx9_36/effect.c
View file @
00927984
...
...
@@ -677,11 +677,11 @@ static void free_technique(struct d3dx_technique *technique)
technique
->
name
=
NULL
;
}
static
void
d3dx
9_base
_effect_cleanup
(
struct
d3dx_effect
*
effect
)
static
void
d3dx_effect_cleanup
(
struct
d3dx_effect
*
effect
)
{
unsigned
int
i
;
TRACE
(
"
E
ffect %p.
\n
"
,
effect
);
TRACE
(
"
e
ffect %p.
\n
"
,
effect
);
heap_free
(
effect
->
full_name_tmp
);
...
...
@@ -690,7 +690,6 @@ static void d3dx9_base_effect_cleanup(struct d3dx_effect *effect)
for
(
i
=
0
;
i
<
effect
->
parameter_count
;
++
i
)
free_top_level_parameter
(
&
effect
->
parameters
[
i
]);
heap_free
(
effect
->
parameters
);
effect
->
parameters
=
NULL
;
}
if
(
effect
->
techniques
)
...
...
@@ -698,37 +697,23 @@ static void d3dx9_base_effect_cleanup(struct d3dx_effect *effect)
for
(
i
=
0
;
i
<
effect
->
technique_count
;
++
i
)
free_technique
(
&
effect
->
techniques
[
i
]);
heap_free
(
effect
->
techniques
);
effect
->
techniques
=
NULL
;
}
if
(
effect
->
objects
)
{
for
(
i
=
0
;
i
<
effect
->
object_count
;
++
i
)
{
free_object
(
&
effect
->
objects
[
i
]);
}
heap_free
(
effect
->
objects
);
effect
->
objects
=
NULL
;
}
}
static
void
free_effect
(
struct
d3dx_effect
*
effect
)
{
TRACE
(
"Free effect %p
\n
"
,
effect
);
d3dx9_base_effect_cleanup
(
effect
);
if
(
effect
->
pool
)
{
effect
->
pool
->
lpVtbl
->
Release
(
effect
->
pool
);
}
if
(
effect
->
manager
)
{
IUnknown_Release
(
effect
->
manager
);
}
IDirect3DDevice9_Release
(
effect
->
device
);
heap_free
(
effect
);
}
static
void
get_vector
(
struct
d3dx_parameter
*
param
,
D3DXVECTOR4
*
vector
)
...
...
@@ -1822,18 +1807,15 @@ static ULONG WINAPI d3dx_effect_AddRef(ID3DXEffect *iface)
static
ULONG
WINAPI
d3dx_effect_Release
(
ID3DXEffect
*
iface
)
{
struct
d3dx_effect
*
This
=
impl_from_ID3DXEffect
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
struct
d3dx_effect
*
effect
=
impl_from_ID3DXEffect
(
iface
);
ULONG
ref
count
=
InterlockedDecrement
(
&
effect
->
ref
);
TRACE
(
"
(%p)->(): Release from %u
\n
"
,
This
,
ref
+
1
);
TRACE
(
"
%p decreasing refcount to %u.
\n
"
,
effect
,
refcount
);
if
(
!
ref
)
{
free_effect
(
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
if
(
!
refcount
)
d3dx_effect_cleanup
(
effect
);
return
ref
;
return
ref
count
;
}
/*** ID3DXBaseEffect methods ***/
...
...
@@ -6330,7 +6312,6 @@ static HRESULT d3dx9_effect_init(struct d3dx_effect *effect, struct IDirect3DDev
error_messages
,
pool_impl
,
skip_constants
)))
{
FIXME
(
"Failed to parse effect, hr %#x.
\n
"
,
hr
);
free_effect
(
effect
);
return
hr
;
}
...
...
@@ -6378,7 +6359,7 @@ HRESULT WINAPI D3DXCreateEffectEx(struct IDirect3DDevice9 *device, const void *s
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create effect object.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
d3dx_effect_cleanup
(
object
);
return
hr
;
}
...
...
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