Fix invalid command profiling logic

This commit is contained in:
Maxime Coste 2021-06-24 12:14:53 +10:00
parent 8fdda6d980
commit 49e2ecdcdb
2 changed files with 2 additions and 2 deletions

View File

@ -514,7 +514,7 @@ void CommandManager::execute_single_command(CommandParameters params,
if (debug_flags & DebugFlags::Commands)
write_to_debug_buffer(format("command {}", join(params, ' ')));
on_scope_end([&] {
auto profile = on_scope_end([&] {
if (not (debug_flags & DebugFlags::Profile))
return;
auto full = std::chrono::duration_cast<std::chrono::microseconds>(Clock::now() - start);

View File

@ -61,7 +61,7 @@ Singleton<T>* Singleton<T>::ms_instance = nullptr;
// This permits to cleanup c-style resources without implementing
// a wrapping class
template<typename T>
class OnScopeEnd
class [[nodiscard]] OnScopeEnd
{
public:
[[gnu::always_inline]]