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
7c2c242b
Commit
7c2c242b
authored
Aug 26, 2014
by
Matteo Bruni
Committed by
Alexandre Julliard
Aug 26, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Release child mesh objects (Valgrind).
parent
aa167f92
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
15 deletions
+48
-15
mesh.c
dlls/d3dx9_36/mesh.c
+39
-12
xfile.c
dlls/d3dx9_36/xfile.c
+9
-3
No files found.
dlls/d3dx9_36/mesh.c
View file @
7c2c242b
...
...
@@ -2751,16 +2751,20 @@ static HRESULT parse_material(ID3DXFileData *filedata, D3DXMATERIAL *material)
return
hr
;
hr
=
child
->
lpVtbl
->
GetType
(
child
,
&
type
);
if
(
FAILED
(
hr
))
return
h
r
;
goto
er
r
;
if
(
IsEqualGUID
(
&
type
,
&
TID_D3DRMTextureFilename
))
{
hr
=
parse_texture_filename
(
child
,
&
material
->
pTextureFilename
);
if
(
FAILED
(
hr
))
return
h
r
;
goto
er
r
;
}
IUnknown_Release
(
child
);
}
return
D3D_OK
;
err:
IUnknown_Release
(
child
);
return
hr
;
}
static
void
destroy_materials
(
struct
mesh_data
*
mesh
)
...
...
@@ -2781,7 +2785,7 @@ static HRESULT parse_material_list(ID3DXFileData *filedata, struct mesh_data *me
SIZE_T
data_size
;
const
DWORD
*
data
,
*
in_ptr
;
GUID
type
;
ID3DXFileData
*
child
;
ID3DXFileData
*
child
=
NULL
;
DWORD
num_materials
;
DWORD
i
;
SIZE_T
nb_children
;
...
...
@@ -2864,6 +2868,9 @@ static HRESULT parse_material_list(ID3DXFileData *filedata, struct mesh_data *me
if
(
FAILED
(
hr
))
goto
end
;
}
IUnknown_Release
(
child
);
child
=
NULL
;
}
if
(
num_materials
!=
mesh
->
num_materials
)
{
WARN
(
"only %u of %u materials defined
\n
"
,
num_materials
,
mesh
->
num_materials
);
...
...
@@ -2871,6 +2878,8 @@ static HRESULT parse_material_list(ID3DXFileData *filedata, struct mesh_data *me
}
end:
if
(
child
)
IUnknown_Release
(
child
);
filedata
->
lpVtbl
->
Unlock
(
filedata
);
return
hr
;
}
...
...
@@ -3168,7 +3177,7 @@ static HRESULT parse_mesh(ID3DXFileData *filedata, struct mesh_data *mesh_data,
const
BYTE
*
data
,
*
in_ptr
;
DWORD
*
index_out_ptr
;
GUID
type
;
ID3DXFileData
*
child
;
ID3DXFileData
*
child
=
NULL
;
DWORD
i
;
SIZE_T
nb_children
;
DWORD
nb_skin_weigths_info
=
0
;
...
...
@@ -3316,6 +3325,9 @@ static HRESULT parse_mesh(ID3DXFileData *filedata, struct mesh_data *mesh_data,
}
if
(
FAILED
(
hr
))
goto
end
;
IUnknown_Release
(
child
);
child
=
NULL
;
}
if
(
mesh_data
->
skin_info
&&
(
nb_skin_weigths_info
!=
mesh_data
->
nb_bones
))
{
...
...
@@ -3328,6 +3340,8 @@ static HRESULT parse_mesh(ID3DXFileData *filedata, struct mesh_data *mesh_data,
hr
=
D3D_OK
;
end:
if
(
child
)
IUnknown_Release
(
child
);
filedata
->
lpVtbl
->
Unlock
(
filedata
);
return
hr
;
}
...
...
@@ -3856,7 +3870,7 @@ static HRESULT load_frame(struct ID3DXFileData *filedata, DWORD options, struct
return
hr
;
hr
=
child
->
lpVtbl
->
GetType
(
child
,
&
type
);
if
(
FAILED
(
hr
))
return
h
r
;
goto
er
r
;
if
(
IsEqualGUID
(
&
type
,
&
TID_D3DRMMesh
))
{
hr
=
load_mesh_container
(
child
,
options
,
device
,
alloc_hier
,
next_container
);
...
...
@@ -3870,10 +3884,15 @@ static HRESULT load_frame(struct ID3DXFileData *filedata, DWORD options, struct
next_child
=
&
(
*
next_child
)
->
pFrameSibling
;
}
if
(
FAILED
(
hr
))
return
hr
;
}
goto
err
;
IUnknown_Release
(
child
);
}
return
D3D_OK
;
err:
IUnknown_Release
(
child
);
return
hr
;
}
HRESULT
WINAPI
D3DXLoadMeshHierarchyFromXInMemory
(
const
void
*
memory
,
DWORD
memory_size
,
DWORD
options
,
...
...
@@ -4139,12 +4158,15 @@ static HRESULT parse_frame(struct ID3DXFileData *filedata, DWORD options, struct
return
hr
;
hr
=
child
->
lpVtbl
->
GetType
(
child
,
&
type
);
if
(
FAILED
(
hr
))
return
h
r
;
goto
er
r
;
if
(
IsEqualGUID
(
&
type
,
&
TID_D3DRMMesh
))
{
struct
mesh_container
*
container
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
container
));
if
(
!
container
)
return
E_OUTOFMEMORY
;
{
hr
=
E_OUTOFMEMORY
;
goto
err
;
}
list_add_tail
(
container_list
,
&
container
->
entry
);
container
->
transform
=
transform
;
...
...
@@ -4160,10 +4182,15 @@ static HRESULT parse_frame(struct ID3DXFileData *filedata, DWORD options, struct
hr
=
parse_frame
(
child
,
options
,
device
,
&
transform
,
container_list
,
provide_flags
);
}
if
(
FAILED
(
hr
))
return
hr
;
}
goto
err
;
IUnknown_Release
(
child
);
}
return
D3D_OK
;
err:
IUnknown_Release
(
child
);
return
hr
;
}
HRESULT
WINAPI
D3DXLoadMeshFromXInMemory
(
const
void
*
memory
,
DWORD
memory_size
,
DWORD
options
,
...
...
dlls/d3dx9_36/xfile.c
View file @
7c2c242b
...
...
@@ -19,6 +19,7 @@
#include "wine/debug.h"
#define COBJMACROS
#include "d3dx9.h"
#include "d3dx9xof.h"
#undef MAKE_DDHRESULT
...
...
@@ -319,6 +320,7 @@ static HRESULT d3dx9_file_data_create(IDirectXFileObject *dxfile_object, ID3DXFi
if
(
SUCCEEDED
(
ret
))
{
ret
=
IDirectXFileDataReference_Resolve
(
reference
,
&
object
->
dxfile_data
);
IUnknown_Release
(
reference
);
if
(
FAILED
(
ret
))
{
HeapFree
(
GetProcessHeap
(),
0
,
object
);
...
...
@@ -345,7 +347,9 @@ static HRESULT d3dx9_file_data_create(IDirectXFileObject *dxfile_object, ID3DXFi
ret
=
E_OUTOFMEMORY
;
break
;
}
if
(
FAILED
(
ret
=
d3dx9_file_data_create
(
data_object
,
&
object
->
children
[
object
->
nb_children
])))
ret
=
d3dx9_file_data_create
(
data_object
,
&
object
->
children
[
object
->
nb_children
]);
IUnknown_Release
(
data_object
);
if
(
FAILED
(
ret
))
break
;
object
->
nb_children
++
;
}
...
...
@@ -599,8 +603,10 @@ static HRESULT WINAPI d3dx9_file_CreateEnumObject(ID3DXFile *iface, const void *
ret
=
E_OUTOFMEMORY
;
break
;
}
if
(
FAILED
(
ret
=
d3dx9_file_data_create
((
IDirectXFileObject
*
)
data_object
,
&
object
->
children
[
object
->
nb_children
])))
ret
=
d3dx9_file_data_create
((
IDirectXFileObject
*
)
data_object
,
&
object
->
children
[
object
->
nb_children
]);
IUnknown_Release
(
data_object
);
if
(
FAILED
(
ret
))
break
;
object
->
nb_children
++
;
}
...
...
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