#include "scopeguard.h" using namespace osdev::components; ScopeGuard::ScopeGuard( const CleanUpFunction& cleanupFunc ) : m_cleanupFunc( cleanupFunc ) { } ScopeGuard::~ScopeGuard() noexcept { try { if( m_cleanupFunc ) { m_cleanupFunc(); } } catch (...) {} }