A few minor code formatting things

This commit is contained in:
Jeremy Rifkin 2025-01-25 11:21:43 -06:00 committed by GitHub
parent 6471e1c8bd
commit 52b5b75004
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,7 +23,7 @@ namespace detail {
if(!SymCleanup(kvp.second)) {
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());
}
}
@ -32,19 +32,19 @@ namespace detail {
HANDLE dbghelp_syminit_manager::init(HANDLE proc) {
auto itr = cache.find(proc);
if (itr != cache.end()) {
if(itr != cache.end()) {
return itr->second;
}
HANDLE duplicated_handle = nullptr;
if (!DuplicateHandle(proc, proc, proc, &duplicated_handle , 0, FALSE, DUPLICATE_SAME_ACCESS)) {
throw internal_error("DuplicateHandle failed {}", GetLastError());
HANDLE duplicated_handle = nullptr;
if(!DuplicateHandle(proc, proc, proc, &duplicated_handle, 0, FALSE, DUPLICATE_SAME_ACCESS)) {
throw internal_error("DuplicateHandle failed {}", GetLastError());
}
if(!SymInitialize(duplicated_handle , NULL, TRUE)) {
throw internal_error("SymInitialize failed {}", GetLastError());
if(!SymInitialize(duplicated_handle, NULL, TRUE)) {
throw internal_error("SymInitialize failed {}", GetLastError());
}
cache[proc] = duplicated_handle ;
return duplicated_handle ;
cache[proc] = duplicated_handle;
return duplicated_handle;
}
// Thread-safety: Must only be called from symbols_with_dbghelp while the dbghelp_lock lock is held