Logo white

open_source / crypter

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Labels
  • Wiki
  • crypter
  • src
  • scopeguard.cpp
  • Fixed Loggin
    0288e1ab
    Peter M. Groen authored
    2023-01-15 18:30:09 +0100  
    Browse Code ยป
scopeguard.cpp 317 Bytes
Edit Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#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 (...) {}
}