From 09961819d8c81ce1873787925722ffc5c18af0d2 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 14 Sep 2020 15:41:30 +0300 Subject: DbgHelp: fix move ctor --- src/dbghelp.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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 { -- cgit v1.2.3