diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-09-14 15:41:30 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-09-14 15:44:13 +0300 |
commit | 09961819d8c81ce1873787925722ffc5c18af0d2 (patch) | |
tree | 55fdf1860cbdfc855055182b0f32c6c52e322b02 | |
parent | test_lib: test -> test_ns (diff) | |
download | winapi-debug-09961819d8c81ce1873787925722ffc5c18af0d2.tar.gz winapi-debug-09961819d8c81ce1873787925722ffc5c18af0d2.zip |
DbgHelp: fix move ctor
-rw-r--r-- | include/pdb/dbghelp.hpp | 2 | ||||
-rw-r--r-- | src/dbghelp.cpp | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/include/pdb/dbghelp.hpp b/include/pdb/dbghelp.hpp index 328df2d..0026bfb 100644 --- a/include/pdb/dbghelp.hpp +++ b/include/pdb/dbghelp.hpp @@ -51,7 +51,7 @@ private: void close(); - HANDLE id = GetCurrentProcess(); + HANDLE id = NULL; DbgHelp(const DbgHelp&) = delete; }; diff --git a/src/dbghelp.cpp b/src/dbghelp.cpp index 8f0f7d6..4b8df7a 100644 --- a/src/dbghelp.cpp +++ b/src/dbghelp.cpp @@ -88,7 +88,7 @@ void enum_symbols(HANDLE id, } // namespace -DbgHelp::DbgHelp(bool invade_current_process) { +DbgHelp::DbgHelp(bool invade_current_process) : id{GetCurrentProcess()} { initialize(id, invade_current_process); } @@ -114,7 +114,8 @@ DbgHelp::~DbgHelp() { } void DbgHelp::close() { - clean_up(id); + if (id != NULL) + clean_up(id); } ModuleInfo DbgHelp::load_pdb(const std::string& path) const { |