ULONG domainsFetched;
while (SUCCEEDED(domains->Next(1, &curDomain, &domainsFetched)) && domainsFetched == 1)
{
- ToRelease<ICorDebugAppDomain> pDomain = curDomain;
+ ToRelease<ICorDebugAppDomain> pDomain(curDomain);
ToRelease<ICorDebugAssemblyEnum> assemblies;
IfFailRet(pDomain->EnumerateAssemblies(&assemblies));
ULONG assembliesFetched;
while (SUCCEEDED(assemblies->Next(1, &curAssembly, &assembliesFetched)) && assembliesFetched == 1)
{
- ToRelease<ICorDebugAssembly> pAssembly = curAssembly;
+ ToRelease<ICorDebugAssembly> pAssembly(curAssembly);
ToRelease<ICorDebugModuleEnum> modules;
IfFailRet(pAssembly->EnumerateModules(&modules));
ULONG modulesFetched;
while (SUCCEEDED(modules->Next(1, &curModule, &modulesFetched)) && modulesFetched == 1)
{
- ToRelease<ICorDebugModule> pModule = curModule;
+ ToRelease<ICorDebugModule> pModule(curModule);
if (SUCCEEDED(ResolveBreakpoint(pModule, filename, linenum, bp)))
{
std::lock_guard<std::mutex> lock(g_breakMutex);
const char *sep = "";
while (SUCCEEDED(Status = pThreads->Next(1, &handle, &fetched)) && fetched == 1)
{
- ToRelease<ICorDebugThread> pThread = handle;
+ ToRelease<ICorDebugThread> pThread(handle);
std::string threadOutput;
PrintThread(pThread, threadOutput);
ULONG breakpointsFetched;
while (SUCCEEDED(breakpoints->Next(1, &curBreakpoint, &breakpointsFetched)) && breakpointsFetched == 1)
{
- ToRelease<ICorDebugBreakpoint> pBreakpoint = curBreakpoint;
+ ToRelease<ICorDebugBreakpoint> pBreakpoint(curBreakpoint);
pBreakpoint->Activate(FALSE);
}
}
ULONG steppersFetched;
while (SUCCEEDED(steppers->Next(1, &curStepper, &steppersFetched)) && steppersFetched == 1)
{
- ToRelease<ICorDebugStepper> pStepper = curStepper;
+ ToRelease<ICorDebugStepper> pStepper(curStepper);
pStepper->Deactivate();
}
}
ULONG domainsFetched;
while (SUCCEEDED(domains->Next(1, &curDomain, &domainsFetched)) && domainsFetched == 1)
{
- ToRelease<ICorDebugAppDomain> pDomain = curDomain;
+ ToRelease<ICorDebugAppDomain> pDomain(curDomain);
DisableAllBreakpointsAndSteppersInAppDomain(pDomain);
}
return S_OK;
}
private:
+ ToRelease(const ToRelease& that) = delete;
T* m_ptr;
};
case ELEMENT_TYPE_FNPTR:
{
CORDB_ADDRESS addr = 0;
- ToRelease<ICorDebugReferenceValue> pReferenceValue = NULL;
+ ToRelease<ICorDebugReferenceValue> pReferenceValue;
if(SUCCEEDED(pValue->QueryInterface(IID_ICorDebugReferenceValue, (LPVOID*) &pReferenceValue)))
pReferenceValue->GetValue(&addr);
ss << "<function pointer 0x" << std::hex << addr << ">";