diff --git a/filament/src/details/Material.cpp b/filament/src/details/Material.cpp index 13dfc3c245..aaebe3d0dd 100644 --- a/filament/src/details/Material.cpp +++ b/filament/src/details/Material.cpp @@ -388,12 +388,13 @@ void FMaterial::terminate(FEngine& engine) { << "destroying material \"" << this->getName().c_str_safe() << "\" but " << pos->second.size() << " instances still alive."; } else { - utils::slog.e << "destroying material \"" << this->getName().c_str_safe() << "\" but " - << pos->second.size() << " instances still alive."; + if (UTILS_UNLIKELY(!pos->second.empty())) { + slog.e << "destroying material \"" << this->getName().c_str_safe() << "\" but " + << pos->second.size() << " instances still alive." << io::endl; + } } } - #if FILAMENT_ENABLE_MATDBG // Unregister the material with matdbg. matdbg::DebugServer* server = engine.debug.server;