Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
Qtquick3d Assimp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Karlsson
Qtquick3d Assimp
Commits
6641188a
Commit
6641188a
authored
9 years ago
by
Kim Kulling
Browse files
Options
Downloads
Patches
Plain Diff
assimp/issues/702: fix resource leak and use initializer list for all
attributes of the loader instance.
parent
87369070
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
code/ColladaParser.cpp
+32
-13
32 additions, 13 deletions
code/ColladaParser.cpp
code/DefaultIOSystem.cpp
+0
-1
0 additions, 1 deletion
code/DefaultIOSystem.cpp
code/OpenGEXImporter.cpp
+13
-0
13 additions, 0 deletions
code/OpenGEXImporter.cpp
with
45 additions
and
14 deletions
code/ColladaParser.cpp
+
32
−
13
View file @
6641188a
...
...
@@ -65,27 +65,46 @@ using namespace Assimp::Collada;
// Constructor to be privately used by Importer
ColladaParser
::
ColladaParser
(
IOSystem
*
pIOHandler
,
const
std
::
string
&
pFile
)
:
mFileName
(
pFile
)
,
mReader
(
NULL
)
,
mDataLibrary
()
,
mAccessorLibrary
()
,
mMeshLibrary
()
,
mNodeLibrary
()
,
mImageLibrary
()
,
mEffectLibrary
()
,
mMaterialLibrary
()
,
mLightLibrary
()
,
mCameraLibrary
()
,
mControllerLibrary
()
,
mRootNode
(
NULL
)
,
mAnims
()
,
mUnitSize
(
1.0
f
)
,
mUpDirection
(
UP_Y
)
,
mFormat
(
FV_1_5_n
)
// We assume the newest file format by default
{
mRootNode
=
NULL
;
mUnitSize
=
1.0
f
;
mUpDirection
=
UP_Y
;
// We assume the newest file format by default
mFormat
=
FV_1_5_n
;
// Validate io-handler instance
if
(
NULL
==
pIOHandler
)
{
throw
DeadlyImportError
(
"IOSystem is NULL."
);
}
// open the file
boost
::
scoped_ptr
<
IOStream
>
file
(
pIOHandler
->
Open
(
pFile
));
if
(
file
.
get
()
==
NULL
)
throw
DeadlyImportError
(
"Failed to open file "
+
pFile
+
"."
);
// open the file
boost
::
scoped_ptr
<
IOStream
>
file
(
pIOHandler
->
Open
(
pFile
)
);
if
(
file
.
get
()
==
NULL
)
{
throw
DeadlyImportError
(
"Failed to open file "
+
pFile
+
"."
);
}
// generate a XML reader for it
boost
::
scoped_ptr
<
CIrrXML_IOStreamReader
>
mIOWrapper
(
new
CIrrXML_IOStreamReader
(
file
.
get
()));
boost
::
scoped_ptr
<
CIrrXML_IOStreamReader
>
mIOWrapper
(
new
CIrrXML_IOStreamReader
(
file
.
get
()));
mReader
=
irr
::
io
::
createIrrXMLReader
(
mIOWrapper
.
get
());
if
(
!
mReader
)
ThrowException
(
"Collada: Unable to open file."
);
if
(
!
mReader
)
{
ThrowException
(
"Collada: Unable to open file."
);
}
// start reading
ReadContents
();
// Release file after import
pIOHandler
->
Close
(
file
.
get
()
);
}
// ------------------------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
code/DefaultIOSystem.cpp
+
0
−
1
View file @
6641188a
...
...
@@ -176,7 +176,6 @@ std::string DefaultIOSystem::fileName( const std::string &path )
return
ret
;
}
// ------------------------------------------------------------------------------------------------
std
::
string
DefaultIOSystem
::
completeBaseName
(
const
std
::
string
&
path
)
{
...
...
This diff is collapsed.
Click to expand it.
code/OpenGEXImporter.cpp
+
13
−
0
View file @
6641188a
...
...
@@ -801,6 +801,19 @@ void OpenGEXImporter::handleColorNode( ODDLParser::DDLNode *node, aiScene *pScen
}
}
//------------------------------------------------------------------------------------------------
bool
isSpecialRootDir
(
aiString
&
texName
)
{
if
(
texName
.
length
<
2
)
{
return
false
;
}
if
(
texName
.
data
[
0
]
=
'/'
||
texName
.
data
[
1
]
==
'/'
)
{
return
true
;
}
return
false
;
}
//------------------------------------------------------------------------------------------------
void
OpenGEXImporter
::
handleTextureNode
(
ODDLParser
::
DDLNode
*
node
,
aiScene
*
pScene
)
{
if
(
NULL
==
node
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment