diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-03-16 17:19:24 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-03-16 17:19:24 +0300 |
commit | c151774911b4ea658410cc6593dd40390862a168 (patch) | |
tree | 2d364e74bfb9923236fdc53d8cc7b64df3dcc883 /src | |
parent | Travis: ignore everything in .dockerignore (diff) | |
download | winapi-debug-c151774911b4ea658410cc6593dd40390862a168.tar.gz winapi-debug-c151774911b4ea658410cc6593dd40390862a168.zip |
DbgHelp: start fixing the API
Diffstat (limited to 'src')
-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 { |