diff options
Diffstat (limited to '')
-rw-r--r-- | src/dbghelp.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/dbghelp.cpp b/src/dbghelp.cpp index efbdede..cb71282 100644 --- a/src/dbghelp.cpp +++ b/src/dbghelp.cpp @@ -91,6 +91,20 @@ DbgHelp::DbgHelp(bool invade_current_process) { initialize(id, invade_current_process); } +void DbgHelp::swap(DbgHelp& other) noexcept { + using std::swap; + swap(id, other.id); +} + +DbgHelp::DbgHelp(DbgHelp&& other) noexcept { + swap(other); +} + +DbgHelp& DbgHelp::operator=(DbgHelp other) noexcept { + swap(other); + return *this; +} + DbgHelp::~DbgHelp() { try { close(); @@ -99,10 +113,7 @@ DbgHelp::~DbgHelp() { } void DbgHelp::close() { - if (!closed) { - clean_up(id); - closed = true; - } + clean_up(id); } ModuleInfo DbgHelp::load_pdb(const std::string& path) const { |