Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Win check #130

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions include/boost/stacktrace/detail/frame_msvc.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ inline void trim_right_zeroes(std::string& s) {
}

class debugging_symbols: boost::noncopyable {
static void try_init_com(com_holder< ::IDebugSymbols>& idebug) noexcept {
com_holder< ::IDebugClient> iclient;
static void try_init_com(com_holder< ::IDebugClient>& iclient, com_holder< ::IDebugSymbols>& idebug) noexcept {
if (S_OK != ::DebugCreate(__uuidof(IDebugClient), iclient.to_void_ptr_ptr())) {
return;
}
Expand Down Expand Up @@ -140,10 +139,18 @@ class debugging_symbols: boost::noncopyable {
#ifndef BOOST_STACKTRACE_USE_WINDBG_CACHED

com_holder< ::IDebugSymbols> idebug_;
com_holder< ::IDebugClient> iclient_;
public:
debugging_symbols() noexcept
{
try_init_com(idebug_);
try_init_com(iclient_, idebug_);
}

~debugging_symbols() BOOST_NOEXCEPT
{
if (iclient_.is_inited()) {
iclient_->DetachProcesses();
}
}

#else
Expand All @@ -158,7 +165,8 @@ public:
static thread_local com_holder< ::IDebugSymbols> idebug;

if (!idebug.is_inited()) {
try_init_com(idebug);
com_holder< ::IDebugClient> iclient;
try_init_com(iclient, idebug);
}

return idebug;
Expand Down
Loading