Remove ToRelease copy constructor
authorIgor Kulaychuk <i.kulaychuk@samsung.com>
Mon, 10 Jul 2017 00:04:36 +0000 (03:04 +0300)
committerIgor Kulaychuk <i.kulaychuk@samsung.com>
Mon, 13 Nov 2017 19:22:40 +0000 (22:22 +0300)
src/debug/debugger/breakpoints.cpp
src/debug/debugger/main.cpp
src/debug/debugger/torelease.h
src/debug/debugger/varobj.cpp

index 8507ad1..84dda0b 100644 (file)
@@ -222,7 +222,7 @@ HRESULT CreateBreakpointInProcess(ICorDebugProcess *pProcess, std::string filena
     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));
@@ -231,7 +231,7 @@ HRESULT CreateBreakpointInProcess(ICorDebugProcess *pProcess, std::string filena
         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));
@@ -240,7 +240,7 @@ HRESULT CreateBreakpointInProcess(ICorDebugProcess *pProcess, std::string filena
             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);
index ec54ef8..7aeb845 100644 (file)
@@ -191,7 +191,7 @@ HRESULT PrintThreadsState(ICorDebugController *controller, std::string &output)
     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);
@@ -253,7 +253,7 @@ HRESULT DisableAllBreakpointsAndSteppersInAppDomain(ICorDebugAppDomain *pAppDoma
         ULONG breakpointsFetched;
         while (SUCCEEDED(breakpoints->Next(1, &curBreakpoint, &breakpointsFetched)) && breakpointsFetched == 1)
         {
-            ToRelease<ICorDebugBreakpoint> pBreakpoint = curBreakpoint;
+            ToRelease<ICorDebugBreakpoint> pBreakpoint(curBreakpoint);
             pBreakpoint->Activate(FALSE);
         }
     }
@@ -267,7 +267,7 @@ HRESULT DisableAllBreakpointsAndSteppersInAppDomain(ICorDebugAppDomain *pAppDoma
         ULONG steppersFetched;
         while (SUCCEEDED(steppers->Next(1, &curStepper, &steppersFetched)) && steppersFetched == 1)
         {
-            ToRelease<ICorDebugStepper> pStepper = curStepper;
+            ToRelease<ICorDebugStepper> pStepper(curStepper);
             pStepper->Deactivate();
         }
     }
@@ -286,7 +286,7 @@ HRESULT DisableAllBreakpointsAndSteppers(ICorDebugProcess *pProcess)
     ULONG domainsFetched;
     while (SUCCEEDED(domains->Next(1, &curDomain, &domainsFetched)) && domainsFetched == 1)
     {
-        ToRelease<ICorDebugAppDomain> pDomain = curDomain;
+        ToRelease<ICorDebugAppDomain> pDomain(curDomain);
         DisableAllBreakpointsAndSteppersInAppDomain(pDomain);
     }
     return S_OK;
index e48b86a..e180659 100644 (file)
@@ -68,6 +68,7 @@ public:
     }
 
 private:
+    ToRelease(const ToRelease& that) = delete;
     T* m_ptr;
 };
 
index b13d0da..8b29c7d 100644 (file)
@@ -171,7 +171,7 @@ HRESULT PrintValue(ICorDebugValue *pInputValue, ICorDebugILFrame * pILFrame, IMe
     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 << ">";