aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/dbghelp.cpp
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-09-14 15:41:30 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-09-14 15:44:13 +0300
commit09961819d8c81ce1873787925722ffc5c18af0d2 (patch)
tree55fdf1860cbdfc855055182b0f32c6c52e322b02 /src/dbghelp.cpp
parenttest_lib: test -> test_ns (diff)
downloadwinapi-debug-09961819d8c81ce1873787925722ffc5c18af0d2.tar.gz
winapi-debug-09961819d8c81ce1873787925722ffc5c18af0d2.zip
DbgHelp: fix move ctor
Diffstat (limited to '')
-rw-r--r--src/dbghelp.cpp5
1 files changed, 3 insertions, 2 deletions
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 {