MCPcopy Create free account
hub / github.com/assimp/assimp / aiDetachLogStream

Function aiDetachLogStream

code/Common/Assimp.cpp:407–433  ·  view source on GitHub ↗

------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

405
406// ------------------------------------------------------------------------------------------------
407ASSIMP_API aiReturn aiDetachLogStream(const aiLogStream *stream) {
408 ASSIMP_BEGIN_EXCEPTION_REGION();
409
410#ifndef ASSIMP_BUILD_SINGLETHREADED
411 std::lock_guard<std::mutex> lock(gLogStreamMutex);
412#endif
413 // find the log-stream associated with this data
414 LogStreamMap::iterator it = gActiveLogStreams.find(*stream);
415 // it should be there... else the user is playing fools with us
416 if (it == gActiveLogStreams.end()) {
417 return AI_FAILURE;
418 }
419 DefaultLogger::get()->detachStream(it->second);
420 delete it->second;
421
422 if ((Assimp::LogStream *)stream->user == DefaultStream) {
423 DefaultStream = nullptr;
424 }
425
426 gActiveLogStreams.erase(it);
427
428 if (gActiveLogStreams.empty()) {
429 DefaultLogger::kill();
430 }
431 ASSIMP_END_EXCEPTION_REGION(aiReturn);
432 return AI_SUCCESS;
433}
434
435// ------------------------------------------------------------------------------------------------
436ASSIMP_API void aiDetachAllLogStreams(void) {

Callers 1

LLVMFuzzerTestOneInputFunction · 0.85

Calls 5

detachStreamMethod · 0.80
eraseMethod · 0.80
getFunction · 0.50
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected