A few minor code formatting things
This commit is contained in:
parent
6471e1c8bd
commit
52b5b75004
@ -23,7 +23,7 @@ namespace detail {
|
|||||||
if(!SymCleanup(kvp.second)) {
|
if(!SymCleanup(kvp.second)) {
|
||||||
ASSERT(false, microfmt::format("Cpptrace SymCleanup failed with code {}\n", GetLastError()).c_str());
|
ASSERT(false, microfmt::format("Cpptrace SymCleanup failed with code {}\n", GetLastError()).c_str());
|
||||||
}
|
}
|
||||||
if (!CloseHandle(kvp.second)) {
|
if(!CloseHandle(kvp.second)) {
|
||||||
ASSERT(false, microfmt::format("Cpptrace CloseHandle failed with code {}\n", GetLastError()).c_str());
|
ASSERT(false, microfmt::format("Cpptrace CloseHandle failed with code {}\n", GetLastError()).c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -32,19 +32,19 @@ namespace detail {
|
|||||||
HANDLE dbghelp_syminit_manager::init(HANDLE proc) {
|
HANDLE dbghelp_syminit_manager::init(HANDLE proc) {
|
||||||
auto itr = cache.find(proc);
|
auto itr = cache.find(proc);
|
||||||
|
|
||||||
if (itr != cache.end()) {
|
if(itr != cache.end()) {
|
||||||
return itr->second;
|
return itr->second;
|
||||||
}
|
}
|
||||||
HANDLE duplicated_handle = nullptr;
|
HANDLE duplicated_handle = nullptr;
|
||||||
if (!DuplicateHandle(proc, proc, proc, &duplicated_handle , 0, FALSE, DUPLICATE_SAME_ACCESS)) {
|
if(!DuplicateHandle(proc, proc, proc, &duplicated_handle, 0, FALSE, DUPLICATE_SAME_ACCESS)) {
|
||||||
throw internal_error("DuplicateHandle failed {}", GetLastError());
|
throw internal_error("DuplicateHandle failed {}", GetLastError());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!SymInitialize(duplicated_handle , NULL, TRUE)) {
|
if(!SymInitialize(duplicated_handle, NULL, TRUE)) {
|
||||||
throw internal_error("SymInitialize failed {}", GetLastError());
|
throw internal_error("SymInitialize failed {}", GetLastError());
|
||||||
}
|
}
|
||||||
cache[proc] = duplicated_handle ;
|
cache[proc] = duplicated_handle;
|
||||||
return duplicated_handle ;
|
return duplicated_handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Thread-safety: Must only be called from symbols_with_dbghelp while the dbghelp_lock lock is held
|
// Thread-safety: Must only be called from symbols_with_dbghelp while the dbghelp_lock lock is held
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user