- don't delete the null logger.

- don't leak LogStreamInfo when detaching streams from DefaultLogger.
- detach the stream before deleting it in aiDetachAllLogStreams.
Thanks to Bart Botta for the patch.

- DefaultLogger does not properly delete log streams if they're still attached to it when the logger is destroyed. This is the behaviour specified in the documentation.
- Adapt AssimpView's logger usage, which didn't follow the spec as well.

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@659 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
aramis_acg
2010-04-10 15:00:36 +00:00
parent 616bd39b6f
commit bcf0ddc086
5 changed files with 18 additions and 8 deletions

View File

@@ -486,7 +486,9 @@ ASSIMP_API aiReturn aiDetachLogStream( const aiLogStream* stream)
if( it == gActiveLogStreams.end()) {
return AI_FAILURE;
}
DefaultLogger::get()->detatchStream( it->second );
delete it->second;
gActiveLogStreams.erase( it);
if (gActiveLogStreams.empty()) {
@@ -504,6 +506,7 @@ ASSIMP_API void aiDetachAllLogStreams(void)
boost::mutex::scoped_lock lock(gLogStreamMutex);
#endif
for (LogStreamMap::iterator it = gActiveLogStreams.begin(); it != gActiveLogStreams.end(); ++it) {
DefaultLogger::get()->detatchStream( it->second );
delete it->second;
}
gActiveLogStreams.clear();