aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/dbghelp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dbghelp.cpp')
-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 {