diff options
author | Jan Vorlicek <janvorli@microsoft.com> | 2015-05-23 00:42:43 +0200 |
---|---|---|
committer | Jan Vorlicek <janvorli@microsoft.com> | 2015-05-26 15:38:54 +0200 |
commit | 90045f8f205c4b91e7804c268e55ae985b1ba4e3 (patch) | |
tree | 7ff227204345da95a16d96648066140ad96be50f | |
parent | 2e7885d43ffbae93891fac2313ac5450be661435 (diff) | |
download | coreclr-90045f8f205c4b91e7804c268e55ae985b1ba4e3.tar.gz coreclr-90045f8f205c4b91e7804c268e55ae985b1ba4e3.tar.bz2 coreclr-90045f8f205c4b91e7804c268e55ae985b1ba4e3.zip |
Fix the virtual destructor warning
This change changes destructors to be virtual or adds virtual ones where they were
missing based on the clang warnings.
63 files changed, 135 insertions, 56 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c0ca81607..8ecc2a5568 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -296,7 +296,6 @@ add_compile_options(-Wno-unknown-warning-option) #These seem to indicate real issues add_compile_options(-Wno-invalid-offsetof) -add_compile_options(-Wno-delete-non-virtual-dtor) # The following warning indicates that an attribute __attribute__((__ms_struct__)) was applied # to a struct or a class that has virtual members or a base class. In that case, clang # may not generate the same object layout as MSVC. diff --git a/src/ToolBox/SOS/Strike/datatarget.h b/src/ToolBox/SOS/Strike/datatarget.h index 3ff78330f6..b0e68d56ca 100644 --- a/src/ToolBox/SOS/Strike/datatarget.h +++ b/src/ToolBox/SOS/Strike/datatarget.h @@ -11,6 +11,7 @@ private: public: DataTarget(void); + virtual ~DataTarget() {} // IUnknown. STDMETHOD(QueryInterface)( diff --git a/src/ToolBox/SOS/Strike/util.cpp b/src/ToolBox/SOS/Strike/util.cpp index 7a516e4885..19c6ef2767 100644 --- a/src/ToolBox/SOS/Strike/util.cpp +++ b/src/ToolBox/SOS/Strike/util.cpp @@ -4280,6 +4280,8 @@ public: { } + virtual ~SOSLibraryProvider() {} + virtual HRESULT STDMETHODCALLTYPE QueryInterface( REFIID InterfaceId, PVOID* pInterface) @@ -4456,6 +4458,8 @@ public: { } + virtual ~SOSDataTarget() {} + virtual HRESULT STDMETHODCALLTYPE QueryInterface( REFIID InterfaceId, PVOID* pInterface) diff --git a/src/binder/inc/fusionassemblyname.hpp b/src/binder/inc/fusionassemblyname.hpp index 8dfb554817..c4a97f92c6 100644 --- a/src/binder/inc/fusionassemblyname.hpp +++ b/src/binder/inc/fusionassemblyname.hpp @@ -108,7 +108,7 @@ public: /* in */ DWORD cbProperty); CAssemblyName(); - ~CAssemblyName(); + virtual ~CAssemblyName(); HRESULT Init(LPCTSTR pszAssemblyName, ASSEMBLYMETADATA *pamd); HRESULT Parse(LPCWSTR szDisplayName); diff --git a/src/debug/daccess/daccess.cpp b/src/debug/daccess/daccess.cpp index 58a0d66f39..ded8ff9272 100644 --- a/src/debug/daccess/daccess.cpp +++ b/src/debug/daccess/daccess.cpp @@ -1334,7 +1334,7 @@ SplitName::CdNextField(ClrDataAccess* dac, fieldTypeHandle); if (!*fieldType && tokenScopeRet) { - delete *tokenScopeRet; + delete (ClrDataModule*)*tokenScopeRet; } return *fieldType ? S_OK : E_OUTOFMEMORY; } diff --git a/src/debug/daccess/dacdbiimpl.h b/src/debug/daccess/dacdbiimpl.h index 766e7345f5..ab9cab54fa 100644 --- a/src/debug/daccess/dacdbiimpl.h +++ b/src/debug/daccess/dacdbiimpl.h @@ -43,7 +43,7 @@ public: DacDbiInterfaceImpl(ICorDebugDataTarget * pTarget, CORDB_ADDRESS baseAddress, IAllocator * pAllocator, IMetaDataLookup * pLookup); // Destructor. - ~DacDbiInterfaceImpl(void); + virtual ~DacDbiInterfaceImpl(void); // Overridden from ClrDataAccess. Gets an internal metadata importer for the file. virtual IMDInternalImport* GetMDImport( diff --git a/src/debug/daccess/dacimpl.h b/src/debug/daccess/dacimpl.h index 2380fc1a25..f33b7fc42b 100644 --- a/src/debug/daccess/dacimpl.h +++ b/src/debug/daccess/dacimpl.h @@ -861,7 +861,7 @@ class ClrDataAccess { public: ClrDataAccess(ICorDebugDataTarget * pTarget, ICLRDataTarget * pLegacyTarget=0); - ~ClrDataAccess(void); + virtual ~ClrDataAccess(void); // IUnknown. STDMETHOD(QueryInterface)(THIS_ @@ -1518,6 +1518,8 @@ public: : mRef(0) { } + + virtual ~DefaultCOMImpl() {} ULONG STDMETHODCALLTYPE AddRef() { @@ -1887,7 +1889,7 @@ class DacStackReferenceWalker : public DefaultCOMImpl<ISOSStackRefEnum> } StackRefChunk; public: DacStackReferenceWalker(ClrDataAccess *dac, DWORD osThreadID); - ~DacStackReferenceWalker(); + virtual ~DacStackReferenceWalker(); HRESULT Init(); @@ -2119,7 +2121,7 @@ class DacHandleWalker : public DefaultCOMImpl<ISOSHandleEnum> public: DacHandleWalker(); - ~DacHandleWalker(); + virtual ~DacHandleWalker(); HRESULT Init(ClrDataAccess *dac, UINT types[], UINT typeCount); HRESULT Init(ClrDataAccess *dac, UINT types[], UINT typeCount, int gen); @@ -2252,7 +2254,7 @@ class ClrDataAppDomain : public IXCLRDataAppDomain public: ClrDataAppDomain(ClrDataAccess* dac, AppDomain* appDomain); - ~ClrDataAppDomain(void); + virtual ~ClrDataAppDomain(void); // IUnknown. STDMETHOD(QueryInterface)(THIS_ @@ -2316,7 +2318,7 @@ class ClrDataAssembly : public IXCLRDataAssembly public: ClrDataAssembly(ClrDataAccess* dac, Assembly* assembly); - ~ClrDataAssembly(void); + virtual ~ClrDataAssembly(void); // IUnknown. STDMETHOD(QueryInterface)(THIS_ @@ -2395,7 +2397,7 @@ class ClrDataModule : public IXCLRDataModule, IXCLRDataModule2 public: ClrDataModule(ClrDataAccess* dac, Module* module); - ~ClrDataModule(void); + virtual ~ClrDataModule(void); // IUnknown. STDMETHOD(QueryInterface)(THIS_ @@ -2600,7 +2602,7 @@ public: Module* module, mdTypeDef token, TypeHandle typeHandle); - ~ClrDataTypeDefinition(void); + virtual ~ClrDataTypeDefinition(void); // IUnknown. STDMETHOD(QueryInterface)(THIS_ @@ -2792,7 +2794,7 @@ public: ClrDataTypeInstance(ClrDataAccess* dac, AppDomain* appDomain, TypeHandle typeHandle); - ~ClrDataTypeInstance(void); + virtual ~ClrDataTypeInstance(void); // IUnknown. STDMETHOD(QueryInterface)(THIS_ @@ -2982,7 +2984,7 @@ public: Module* module, mdMethodDef token, MethodDesc* methodDesc); - ~ClrDataMethodDefinition(void); + virtual ~ClrDataMethodDefinition(void); // IUnknown. STDMETHOD(QueryInterface)(THIS_ @@ -3091,7 +3093,7 @@ public: ClrDataMethodInstance(ClrDataAccess* dac, AppDomain* appDomain, MethodDesc* methodDesc); - ~ClrDataMethodInstance(void); + virtual ~ClrDataMethodInstance(void); // IUnknown. STDMETHOD(QueryInterface)(THIS_ @@ -3200,7 +3202,7 @@ class ClrDataTask : public IXCLRDataTask public: ClrDataTask(ClrDataAccess* dac, Thread* Thread); - ~ClrDataTask(void); + virtual ~ClrDataTask(void); // IUnknown. STDMETHOD(QueryInterface)(THIS_ @@ -3296,7 +3298,7 @@ public: ClrDataStackWalk(ClrDataAccess* dac, Thread* Thread, ULONG32 flags); - ~ClrDataStackWalk(void); + virtual ~ClrDataStackWalk(void); // IUnknown. STDMETHOD(QueryInterface)(THIS_ @@ -3384,7 +3386,7 @@ public: CLRDataDetailedFrameType detailedType, AppDomain* appDomain, MethodDesc* methodDesc); - ~ClrDataFrame(void); + virtual ~ClrDataFrame(void); // IUnknown. STDMETHOD(QueryInterface)(THIS_ @@ -3507,7 +3509,7 @@ public: ClrDataExStateType* exInfo, OBJECTHANDLE throwable, ClrDataExStateType* prevExInfo); - ~ClrDataExceptionState(void); + virtual ~ClrDataExceptionState(void); // IUnknown. STDMETHOD(QueryInterface)(THIS_ @@ -3599,7 +3601,7 @@ public: ULONG64 baseAddr, ULONG32 numLocs, NativeVarLocation* locs); - ~ClrDataValue(void); + virtual ~ClrDataValue(void); // IUnknown. STDMETHOD(QueryInterface)(THIS_ diff --git a/src/debug/daccess/inspect.cpp b/src/debug/daccess/inspect.cpp index 2a32d79005..1bd7d961d0 100644 --- a/src/debug/daccess/inspect.cpp +++ b/src/debug/daccess/inspect.cpp @@ -1509,7 +1509,7 @@ ClrDataValue::NewFromFieldDesc(ClrDataAccess* dac, { if (tokenScopeRet) { - delete *tokenScopeRet; + delete (ClrDataModule*)*tokenScopeRet; } return E_OUTOFMEMORY; } diff --git a/src/debug/daccess/task.cpp b/src/debug/daccess/task.cpp index dbef28296e..fdf092c96f 100644 --- a/src/debug/daccess/task.cpp +++ b/src/debug/daccess/task.cpp @@ -4609,7 +4609,7 @@ ClrDataExceptionState::GetManagedObject( } NativeVarLocation varLoc; - IXCLRDataValue* RefVal; + ClrDataValue* RefVal; varLoc.addr = TO_CDADDR(m_throwable); varLoc.size = sizeof(TADDR); diff --git a/src/debug/di/classfactory.h b/src/debug/di/classfactory.h index c78be825d8..e9fd8d6353 100644 --- a/src/debug/di/classfactory.h +++ b/src/debug/di/classfactory.h @@ -36,6 +36,7 @@ public: : m_cRef(1), m_pfnCreateObject(pfnCreateObject) { } + virtual ~CClassFactory() {} // // IUnknown methods. diff --git a/src/debug/di/dbgtransportpipeline.cpp b/src/debug/di/dbgtransportpipeline.cpp index 9fd1d9090b..44c44f15fb 100644 --- a/src/debug/di/dbgtransportpipeline.cpp +++ b/src/debug/di/dbgtransportpipeline.cpp @@ -67,7 +67,7 @@ public: _ASSERTE(!IsTransportRunning()); } - ~DbgTransportPipeline() + virtual ~DbgTransportPipeline() { Dispose(); } diff --git a/src/debug/di/remoteeventchannel.cpp b/src/debug/di/remoteeventchannel.cpp index f57ecff884..bdf030e311 100644 --- a/src/debug/di/remoteeventchannel.cpp +++ b/src/debug/di/remoteeventchannel.cpp @@ -26,6 +26,8 @@ public: DbgTransportTarget * pProxy, DbgTransportSession * pTransport); + virtual ~RemoteEventChannel() {} + // Inititalize the event channel. virtual HRESULT Init(HANDLE hTargetProc); diff --git a/src/debug/di/rspriv.h b/src/debug/di/rspriv.h index 249081a4ea..e2f7ea6d8d 100644 --- a/src/debug/di/rspriv.h +++ b/src/debug/di/rspriv.h @@ -7791,6 +7791,8 @@ public: // constructor to initialize an instance of EnregisteredValueHome EnregisteredValueHome(const CordbNativeFrame * pFrame); + virtual ~EnregisteredValueHome() {} + // virtual "copy constructor" to make a copy of "this" to be owned by a different instance of // Cordb*Value. If an instance of CordbVCObjectValue represents an enregistered value class, it means // there is a single field. This implies that the register for the CordbVCObject instance is the same as @@ -7805,7 +7807,6 @@ public: // derived impls to return the cloned copy as its actual derived type, and not just as a base type. - virtual EnregisteredValueHome * Clone() const = 0; @@ -8221,6 +8222,9 @@ class ValueHome public: ValueHome(CordbProcess * pProcess): m_pProcess(pProcess) { _ASSERTE(pProcess != NULL); }; + + virtual + ~ValueHome() {} // releases resources as necessary virtual @@ -10147,6 +10151,8 @@ class RCETWorkItem { public: + virtual ~RCETWorkItem() {} + // Item is executed and then removed from the list and deleted. virtual void Do() = 0; diff --git a/src/debug/di/shimdatatarget.h b/src/debug/di/shimdatatarget.h index a9c467bcec..1fabad4778 100644 --- a/src/debug/di/shimdatatarget.h +++ b/src/debug/di/shimdatatarget.h @@ -24,6 +24,8 @@ typedef HRESULT (*FPContinueStatusChanged)(void * pUserData, DWORD dwThreadId, C class ShimDataTarget : public ICorDebugMutableDataTarget { public: + virtual ~ShimDataTarget() {} + // Allow hooking an implementation for ContinueStatusChanged. void HookContinueStatusChanged(FPContinueStatusChanged fpContinueStatusChanged, void * pUserData); diff --git a/src/debug/di/shimpriv.h b/src/debug/di/shimpriv.h index 4a6179c007..c02c41d0f6 100644 --- a/src/debug/di/shimpriv.h +++ b/src/debug/di/shimpriv.h @@ -69,6 +69,7 @@ class ShimProxyCallback : public: ShimProxyCallback(ShimProcess * pShim); + virtual ~ShimProxyCallback() {} // Implement IUnknown ULONG STDMETHODCALLTYPE AddRef(); @@ -857,7 +858,7 @@ public: CorDebugChainReason chainReason, BOOL fIsManaged, RSLock * pShimLock); - ~ShimChain(); + virtual ~ShimChain(); void Neuter(); BOOL IsNeutered(); @@ -939,7 +940,7 @@ class ShimChainEnum : public ICorDebugChainEnum { public: ShimChainEnum(ShimStackWalk * pSW, RSLock * pShimLock); - ~ShimChainEnum(); + virtual ~ShimChainEnum(); void Neuter(); BOOL IsNeutered(); @@ -999,7 +1000,7 @@ class ShimFrameEnum : public ICorDebugFrameEnum { public: ShimFrameEnum(ShimStackWalk * pSW, ShimChain * pChain, UINT32 frameStartIndex, UINT32 frameEndIndex, RSLock * pShimLock); - ~ShimFrameEnum(); + virtual ~ShimFrameEnum(); void Neuter(); BOOL IsNeutered(); diff --git a/src/debug/di/shimremotedatatarget.cpp b/src/debug/di/shimremotedatatarget.cpp index 278ef68016..cf60e226b7 100644 --- a/src/debug/di/shimremotedatatarget.cpp +++ b/src/debug/di/shimremotedatatarget.cpp @@ -27,7 +27,7 @@ class ShimRemoteDataTarget : public ShimDataTarget public: ShimRemoteDataTarget(DWORD processId, DbgTransportTarget * pProxy, DbgTransportSession * pTransport); - ~ShimRemoteDataTarget(); + virtual ~ShimRemoteDataTarget(); virtual void Dispose(); diff --git a/src/debug/di/symbolinfo.h b/src/debug/di/symbolinfo.h index 22250eb08c..46c7ff9e93 100644 --- a/src/debug/di/symbolinfo.h +++ b/src/debug/di/symbolinfo.h @@ -68,7 +68,7 @@ class SymbolInfo: IMetaDataEmit, IMetaDataImport ClassProps* FindClass(mdToken cls); SignatureProps* FindSignature(SBuffer& sig); - ~SymbolInfo(); // protected, b/c the lifetime is controlled by refcount + virtual ~SymbolInfo(); // protected, b/c the lifetime is controlled by refcount public: SymbolInfo(); diff --git a/src/debug/ee/debugger.h b/src/debug/ee/debugger.h index 96103844a9..9b98f6bde6 100644 --- a/src/debug/ee/debugger.h +++ b/src/debug/ee/debugger.h @@ -1655,7 +1655,9 @@ public: #ifndef DACCESS_COMPILE Debugger(); - ~Debugger(); + virtual ~Debugger(); +#else + virtual ~Debugger() {} #endif // If 0, then not yet initialized. If non-zero, then LS is initialized. diff --git a/src/debug/ildbsymlib/classfactory.h b/src/debug/ildbsymlib/classfactory.h index 65c50059f4..fc9a8b22b8 100644 --- a/src/debug/ildbsymlib/classfactory.h +++ b/src/debug/ildbsymlib/classfactory.h @@ -49,6 +49,7 @@ public: : m_cRef(1), m_pCoClass(pCoClass) { } + virtual ~CIldbClassFactory() {} // // IUnknown methods. diff --git a/src/debug/ildbsymlib/symbinder.h b/src/debug/ildbsymlib/symbinder.h index 6f2955d201..0085e2bc42 100644 --- a/src/debug/ildbsymlib/symbinder.h +++ b/src/debug/ildbsymlib/symbinder.h @@ -23,6 +23,9 @@ public: { m_refCount = 0; } + + virtual ~SymBinder() {} + static HRESULT NewSymBinder( REFCLSID clsid, void** ppObj ); // IUnknown methods diff --git a/src/debug/ildbsymlib/symread.h b/src/debug/ildbsymlib/symread.h index eb85334589..f7992c8d76 100644 --- a/src/debug/ildbsymlib/symread.h +++ b/src/debug/ildbsymlib/symread.h @@ -34,7 +34,7 @@ public: memset(&m_DataPointers, 0, sizeof(PDBDataPointers)); m_szPath[0] = '\0'; } - ~SymReader(); + virtual ~SymReader(); static HRESULT NewSymReader( REFCLSID clsid, void** ppObj ); public: @@ -176,7 +176,7 @@ public: pReader->AddRef(); } - ~SymDocument() + virtual ~SymDocument() { RELEASE(m_pReader); } @@ -266,7 +266,7 @@ public: pSymReader->AddRef(); } - ~SymMethod() + virtual ~SymMethod() { RELEASE(m_pReader); }; @@ -363,7 +363,7 @@ public: m_ScopeEntry = ScopeEntry; m_refCount = 0; } - ~SymScope() + virtual ~SymScope() { RELEASE(m_pSymMethod); } @@ -435,7 +435,7 @@ public: m_pScope = pScope; pScope->AddRef(); } - ~SymReaderVar() + virtual ~SymReaderVar() { RELEASE(m_pScope); } diff --git a/src/debug/ildbsymlib/symwrite.h b/src/debug/ildbsymlib/symwrite.h index de4ddce9fa..cbd68c5047 100644 --- a/src/debug/ildbsymlib/symwrite.h +++ b/src/debug/ildbsymlib/symwrite.h @@ -1167,7 +1167,7 @@ public: SymDocumentWriter(UINT32 DocumentEntry, SymWriter *pEmitter); - ~SymDocumentWriter(); + virtual ~SymDocumentWriter(); //----------------------------------------------------------- // IUnknown support diff --git a/src/debug/inc/readonlydatatargetfacade.h b/src/debug/inc/readonlydatatargetfacade.h index 5ba4ac39ca..a1da51f16e 100644 --- a/src/debug/inc/readonlydatatargetfacade.h +++ b/src/debug/inc/readonlydatatargetfacade.h @@ -38,6 +38,7 @@ class ReadOnlyDataTargetFacade : public ICorDebugMutableDataTarget { public: ReadOnlyDataTargetFacade(); + virtual ~ReadOnlyDataTargetFacade() {} // // IUnknown. diff --git a/src/debug/shim/debugshim.h b/src/debug/shim/debugshim.h index c5d85e3e37..50b4663b3c 100644 --- a/src/debug/shim/debugshim.h +++ b/src/debug/shim/debugshim.h @@ -33,6 +33,8 @@ public: { } + virtual ~CLRDebuggingImpl() {} + public: // ICLRDebugging methods: STDMETHOD(OpenVirtualProcess( diff --git a/src/gc/gc.h b/src/gc/gc.h index 60e3dfda5d..ae2a7f572b 100644 --- a/src/gc/gc.h +++ b/src/gc/gc.h @@ -362,6 +362,9 @@ class GCHeap { #endif public: + + virtual ~GCHeap() {} + static GCHeap *GetGCHeap() { #ifdef CLR_STANDALONE_BINDER diff --git a/src/inc/ceegen.h b/src/inc/ceegen.h index 13e1524601..8846780278 100644 --- a/src/inc/ceegen.h +++ b/src/inc/ceegen.h @@ -215,6 +215,9 @@ class CCeeGen : public ICeeGen, ICeeGenInternal { CCeeGen(); public: + + virtual ~CCeeGen() {} + static HRESULT CreateNewInstance(CCeeGen* & pCeeFileGen); // call this to instantiate virtual HRESULT Cleanup(); diff --git a/src/inc/ceegentokenmapper.h b/src/inc/ceegentokenmapper.h index 67ec17a1a9..bc8e604100 100644 --- a/src/inc/ceegentokenmapper.h +++ b/src/inc/ceegentokenmapper.h @@ -51,6 +51,7 @@ public: static int IndexForType(mdToken tk); CeeGenTokenMapper() : m_pIImport(0), m_cRefs(1), m_pIMapToken(NULL) { LIMITED_METHOD_CONTRACT; } + virtual ~CeeGenTokenMapper() {} //***************************************************************************** // IUnknown implementation. diff --git a/src/inc/corhost.h b/src/inc/corhost.h index 133fb9c340..8eb56b1565 100644 --- a/src/inc/corhost.h +++ b/src/inc/corhost.h @@ -753,6 +753,7 @@ class CorHost2 : public: CorHost2(); + virtual ~CorHost2() {} // *** IUnknown methods *** STDMETHODIMP QueryInterface(REFIID riid, void** ppv); diff --git a/src/inc/factory.h b/src/inc/factory.h index f22722202c..c319c82ea1 100644 --- a/src/inc/factory.h +++ b/src/inc/factory.h @@ -12,6 +12,7 @@ class Factory { public: virtual PRODUCT* Create() = 0; + virtual ~Factory() {} }; template<typename PRODUCT, DWORD MAX_FACTORY_PRODUCT = 64> diff --git a/src/inc/loaderheap.h b/src/inc/loaderheap.h index 8b72ac2b00..7e9bee66db 100644 --- a/src/inc/loaderheap.h +++ b/src/inc/loaderheap.h @@ -486,16 +486,19 @@ public: m_fExplicitControl = FALSE; } - ~LoaderHeap() +#endif // DACCESS_COMPILE + + virtual ~LoaderHeap() { WRAPPER_NO_CONTRACT; +#ifndef DACCESS_COMPILE if (m_CriticalSection != NULL) { ClrDeleteCriticalSection(m_CriticalSection); } - } #endif // DACCESS_COMPILE + } diff --git a/src/inc/pesectionman.h b/src/inc/pesectionman.h index ad5daf60f2..5f767b964b 100644 --- a/src/inc/pesectionman.h +++ b/src/inc/pesectionman.h @@ -22,6 +22,9 @@ struct _IMAGE_SECTION_HEADER; class PESectionMan { public: + + virtual ~PESectionMan() {} + HRESULT Init(); HRESULT Cleanup(); @@ -147,7 +150,7 @@ class PESection : public CeeSectionImpl { // Cause the section to allocate memory in smaller chunks void SetInitialGrowth(unsigned growth); - ~PESection(); + virtual ~PESection(); private: // purposely not defined, diff --git a/src/inc/stgpool.h b/src/inc/stgpool.h index 7426b0e521..153a5b7e04 100644 --- a/src/inc/stgpool.h +++ b/src/inc/stgpool.h @@ -1247,6 +1247,8 @@ public: m_dataCopy(NULL) { LIMITED_METHOD_CONTRACT; } + virtual ~CInMemoryStream() {} + void InitNew( void *pMem, ULONG cbSize) @@ -1405,7 +1407,7 @@ public: CGrowableStream(float multiplicativeGrowthRate = 2.0, DWORD additiveGrowthRate = 4096); #ifndef DACCESS_COMPILE - ~CGrowableStream(); + virtual ~CGrowableStream(); #endif // Expose the total raw buffer. diff --git a/src/inc/testhook.h b/src/inc/testhook.h index fa28b81eeb..16773a7f3e 100644 --- a/src/inc/testhook.h +++ b/src/inc/testhook.h @@ -104,6 +104,7 @@ public: { m_cRef=0; } + virtual ~CLRTestHook() {} STDMETHOD(AppDomainStageChanged)(DWORD adid,DWORD oldstage,DWORD newstage){ return S_OK;}; STDMETHOD(NextFileLoadLevel)(DWORD adid, LPVOID domainfile,DWORD newlevel){ return S_OK;}; STDMETHOD(CompletingFileLoadLevel)(DWORD adid, LPVOID domainfile,DWORD newlevel){ return S_OK;}; diff --git a/src/md/compiler/classfactory.h b/src/md/compiler/classfactory.h index 636af7713f..13a1481994 100644 --- a/src/md/compiler/classfactory.h +++ b/src/md/compiler/classfactory.h @@ -49,6 +49,7 @@ public: : m_cRef(1), m_pCoClass(pCoClass) { } + virtual ~MDClassFactory() {} // // IUnknown methods. diff --git a/src/md/compiler/disp.h b/src/md/compiler/disp.h index 66bd02465f..39fed7cb95 100644 --- a/src/md/compiler/disp.h +++ b/src/md/compiler/disp.h @@ -24,7 +24,7 @@ class Disp : { public: Disp(); - ~Disp(); + virtual ~Disp(); // *** IUnknown methods *** STDMETHODIMP QueryInterface(REFIID riid, void** ppv); diff --git a/src/md/compiler/regmeta.h b/src/md/compiler/regmeta.h index eca31fd498..d2ca0fa0ca 100644 --- a/src/md/compiler/regmeta.h +++ b/src/md/compiler/regmeta.h @@ -1560,7 +1560,7 @@ public: //***************************************************************************** RegMeta(); - ~RegMeta(); + virtual ~RegMeta(); HRESULT SetOption(OptionValue *pOptionValue); diff --git a/src/md/inc/mdinternalrw.h b/src/md/inc/mdinternalrw.h index 968d0232a9..256a7971ad 100644 --- a/src/md/inc/mdinternalrw.h +++ b/src/md/inc/mdinternalrw.h @@ -26,7 +26,7 @@ public: MDInternalRW(); - ~MDInternalRW(); + virtual ~MDInternalRW(); __checkReturn HRESULT Init(LPVOID pData, ULONG cbData, int bReadOnly); __checkReturn diff --git a/src/md/inc/rwutil.h b/src/md/inc/rwutil.h index 61dc487f0b..ceada1e6f3 100644 --- a/src/md/inc/rwutil.h +++ b/src/md/inc/rwutil.h @@ -195,7 +195,7 @@ public: STDMETHODIMP_(ULONG) Release(); STDMETHODIMP Map(mdToken tkImp, mdToken tkEmit); MergeTokenManager(MDTOKENMAP *pTkMapList, IUnknown *pHandler); - ~MergeTokenManager(); + virtual ~MergeTokenManager(); private: LONG m_cRef; MDTOKENMAP *m_pTkMapList; @@ -222,7 +222,7 @@ public: STDMETHODIMP Map(mdToken tkImp, mdToken tkEmit); bool Find(mdToken tkFrom, TOKENREC **pRecTo); CMapToken(); - ~CMapToken(); + virtual ~CMapToken(); MDTOKENMAP *m_pTKMap; private: LONG m_cRef; diff --git a/src/md/inc/stgtiggerstorage.h b/src/md/inc/stgtiggerstorage.h index d00b6a49b1..f0b1b59c19 100644 --- a/src/md/inc/stgtiggerstorage.h +++ b/src/md/inc/stgtiggerstorage.h @@ -67,7 +67,7 @@ class TiggerStorage : friend class TiggerStream; public: TiggerStorage(); - ~TiggerStorage(); + virtual ~TiggerStorage(); // IUnknown so you can ref count this thing. virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, PVOID *pp) diff --git a/src/md/inc/stgtiggerstream.h b/src/md/inc/stgtiggerstream.h index f28d9659dc..e272610b7c 100644 --- a/src/md/inc/stgtiggerstream.h +++ b/src/md/inc/stgtiggerstream.h @@ -36,6 +36,8 @@ public: m_cRef(1) {} + virtual ~TiggerStream() {} + virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, PVOID *pp) { return (BadError(E_NOTIMPL)); } virtual ULONG STDMETHODCALLTYPE AddRef() diff --git a/src/md/runtime/mdinternalro.h b/src/md/runtime/mdinternalro.h index 70e1df4f04..3095c43a07 100644 --- a/src/md/runtime/mdinternalro.h +++ b/src/md/runtime/mdinternalro.h @@ -22,7 +22,7 @@ class MDInternalRO : public IMDInternalImport, IMDCommon public: MDInternalRO(); - ~MDInternalRO(); + virtual ~MDInternalRO(); __checkReturn HRESULT Init(LPVOID pData, ULONG cbData); diff --git a/src/vm/appdomain.hpp b/src/vm/appdomain.hpp index 4be9dcc4b1..6649c66db4 100644 --- a/src/vm/appdomain.hpp +++ b/src/vm/appdomain.hpp @@ -1093,6 +1093,7 @@ public: // Initialization/shutdown routines for every instance of an BaseDomain. BaseDomain(); + virtual ~BaseDomain() {} void Init(); void Stop(); void Terminate(); diff --git a/src/vm/assembly.cpp b/src/vm/assembly.cpp index 8e6d8b2384..ba722d6f95 100644 --- a/src/vm/assembly.cpp +++ b/src/vm/assembly.cpp @@ -494,7 +494,7 @@ void Assembly::Terminate( BOOL signalProfiler ) if (this->m_fTerminated) return; - delete m_pSharedSecurityDesc; + Security::DeleteSharedSecurityDescriptor(m_pSharedSecurityDesc); m_pSharedSecurityDesc = NULL; if (m_pClassLoader != NULL) diff --git a/src/vm/codeman.h b/src/vm/codeman.h index 0d1c7de622..8740b6c78c 100644 --- a/src/vm/codeman.h +++ b/src/vm/codeman.h @@ -645,6 +645,7 @@ class CodeFragmentHeap : public ILoaderHeapBackout public: CodeFragmentHeap(LoaderAllocator * pAllocator, StubCodeBlockKind kind); + virtual ~CodeFragmentHeap() {} TaggedMemAllocPtr RealAllocAlignedMem(size_t dwRequestedSize ,unsigned dwAlignment diff --git a/src/vm/comdynamic.h b/src/vm/comdynamic.h index bb898bb776..bb7c3d0f10 100644 --- a/src/vm/comdynamic.h +++ b/src/vm/comdynamic.h @@ -192,7 +192,7 @@ public: STDMETHODIMP_(ULONG) Release(); STDMETHODIMP Map(mdToken tkImp, mdToken tkEmit); CSymMapToken(ISymUnmanagedWriter *pWriter, IMapToken *pMapToken); - ~CSymMapToken(); + virtual ~CSymMapToken(); private: LONG m_cRef; ISymUnmanagedWriter *m_pWriter; diff --git a/src/vm/compile.h b/src/vm/compile.h index 9c5a62de5f..b13954116c 100644 --- a/src/vm/compile.h +++ b/src/vm/compile.h @@ -183,6 +183,8 @@ typedef SHash<ZapperLoaderModuleTableTraits> ZapperLoaderModuleTable; class CEECompileInfo : public ICorCompileInfo { public: + virtual ~CEECompileInfo() {} + HRESULT Startup( BOOL fForceDebug, BOOL fForceProfiling, BOOL fForceInstrument); @@ -571,7 +573,7 @@ class CEEPreloader : public ICorCompilePreloader public: CEEPreloader(Module *pModule, ICorCompileDataStore *pData); - ~CEEPreloader(); + virtual ~CEEPreloader(); void Preload(CorProfileData * profileData); DataImage * GetDataImage() { LIMITED_METHOD_CONTRACT; return m_image; } diff --git a/src/vm/coreclr/corebindresult.h b/src/vm/coreclr/corebindresult.h index aae7752c87..b33b0cfd09 100644 --- a/src/vm/coreclr/corebindresult.h +++ b/src/vm/coreclr/corebindresult.h @@ -37,6 +37,7 @@ public: // CoreBindResult methods CoreBindResult() : m_cRef(1) {} + virtual ~CoreBindResult() {} void Init(ICLRPrivAssembly* pAssembly, BOOL bFromGAC, BOOL bIsOnTpaList); void Reset(); diff --git a/src/vm/dllimport.cpp b/src/vm/dllimport.cpp index a742aa3b6c..c7f93bca7b 100644 --- a/src/vm/dllimport.cpp +++ b/src/vm/dllimport.cpp @@ -185,6 +185,8 @@ public: virtual void EmitInvokeTarget(MethodDesc *pStubMD) = 0; virtual void FinishEmit(MethodDesc* pMD) = 0; + + virtual ~StubState() {} }; class ILStubState : public StubState diff --git a/src/vm/eedbginterfaceimpl.h b/src/vm/eedbginterfaceimpl.h index f743dd02c1..938e9bcb52 100644 --- a/src/vm/eedbginterfaceimpl.h +++ b/src/vm/eedbginterfaceimpl.h @@ -40,6 +40,8 @@ class EEDbgInterfaceImpl : public EEDebugInterface public: + virtual ~EEDbgInterfaceImpl() {} + #ifndef DACCESS_COMPILE // diff --git a/src/vm/hash.h b/src/vm/hash.h index 2fd4418d67..1e30b5a39d 100644 --- a/src/vm/hash.h +++ b/src/vm/hash.h @@ -139,6 +139,8 @@ public: m_ptr = ptr; } + virtual ~Compare() {} + virtual UPTR CompareHelper(UPTR val1, UPTR storedval) { WRAPPER_NO_CONTRACT; diff --git a/src/vm/ilmarshalers.h b/src/vm/ilmarshalers.h index e78a54f658..a1b0fb69d4 100644 --- a/src/vm/ilmarshalers.h +++ b/src/vm/ilmarshalers.h @@ -235,6 +235,8 @@ public: { } + virtual ~ILMarshaler() {} + void SetNDirectStubLinker(NDirectStubLinker* pslNDirect) { LIMITED_METHOD_CONTRACT; diff --git a/src/vm/ilstubcache.h b/src/vm/ilstubcache.h index 1f9556fc71..757ec73e13 100644 --- a/src/vm/ilstubcache.h +++ b/src/vm/ilstubcache.h @@ -67,7 +67,7 @@ public: //--------------------------------------------------------- // Destructor //--------------------------------------------------------- - ~ILStubCache(); + virtual ~ILStubCache(); void Init(LoaderHeap* pHeap); diff --git a/src/vm/jitinterface.h b/src/vm/jitinterface.h index 5977b176d9..6c1c7dd77b 100644 --- a/src/vm/jitinterface.h +++ b/src/vm/jitinterface.h @@ -1093,7 +1093,7 @@ public: LIMITED_METHOD_CONTRACT; } - ~CEEInfo() + virtual ~CEEInfo() { LIMITED_METHOD_CONTRACT; } diff --git a/src/vm/pefile.h b/src/vm/pefile.h index 4a64d9aec0..5f0fa57d95 100644 --- a/src/vm/pefile.h +++ b/src/vm/pefile.h @@ -508,6 +508,8 @@ protected: virtual ~PEFile(); virtual void ReleaseIL(); +#else + virtual ~PEFile() {} #endif void OpenMDImport(); diff --git a/src/vm/security.cpp b/src/vm/security.cpp index e263c326f4..5c9662e8ae 100644 --- a/src/vm/security.cpp +++ b/src/vm/security.cpp @@ -35,6 +35,13 @@ ISharedSecurityDescriptor* Security::CreateSharedSecurityDescriptor(Assembly* pA return static_cast<ISharedSecurityDescriptor*>(new SharedSecurityDescriptor(pAssembly)); } +void Security::DeleteSharedSecurityDescriptor(ISharedSecurityDescriptor *descriptor) +{ + WRAPPER_NO_CONTRACT; + + delete static_cast<SharedSecurityDescriptor *>(descriptor); +} + #ifndef FEATURE_CORECLR IPEFileSecurityDescriptor* Security::CreatePEFileSecurityDescriptor(AppDomain* pDomain, PEFile *pPEFile) { diff --git a/src/vm/security.h b/src/vm/security.h index fbc9256138..13e3fb76e1 100644 --- a/src/vm/security.h +++ b/src/vm/security.h @@ -165,6 +165,7 @@ namespace Security IApplicationSecurityDescriptor* CreateApplicationSecurityDescriptor(AppDomain * pDomain); IAssemblySecurityDescriptor* CreateAssemblySecurityDescriptor(AppDomain *pDomain, DomainAssembly *pAssembly, LoaderAllocator *pLoaderAllocator); ISharedSecurityDescriptor* CreateSharedSecurityDescriptor(Assembly* pAssembly); + void DeleteSharedSecurityDescriptor(ISharedSecurityDescriptor *descriptor); #ifndef FEATURE_CORECLR IPEFileSecurityDescriptor* CreatePEFileSecurityDescriptor(AppDomain* pDomain, PEFile *pPEFile); #endif diff --git a/src/vm/securitydescriptorassembly.h b/src/vm/securitydescriptorassembly.h index 306ac24517..e35234e26b 100644 --- a/src/vm/securitydescriptorassembly.h +++ b/src/vm/securitydescriptorassembly.h @@ -183,6 +183,7 @@ private: public: SharedSecurityDescriptor(Assembly *pAssembly); + virtual ~SharedSecurityDescriptor() {} // All policy resolution is funnelled through the shared descriptor so we // can guarantee everyone's using the same grant/denied sets. diff --git a/src/vm/testhookmgr.h b/src/vm/testhookmgr.h index 2eaa008edd..319bcf550c 100644 --- a/src/vm/testhookmgr.h +++ b/src/vm/testhookmgr.h @@ -54,7 +54,7 @@ protected: Volatile<LONG> m_nHooks; Volatile<LONG> m_cRef; CLRTestHookInfo m_pHooks[MAX_TEST_HOOKS]; - ~CLRTestHookManager(); + virtual ~CLRTestHookManager(); public: CLRTestHookManager(); STDMETHOD(AddTestHook)(ICLRTestHook* hook); diff --git a/src/vm/threads.h b/src/vm/threads.h index 28c593c103..30f8180cd3 100644 --- a/src/vm/threads.h +++ b/src/vm/threads.h @@ -2079,7 +2079,9 @@ public: // Destructor //-------------------------------------------------------------- #ifndef DACCESS_COMPILE - ~Thread(); + virtual ~Thread(); +#else + virtual ~Thread() {} #endif #ifdef FEATURE_COMINTEROP_APARTMENT_SUPPORT diff --git a/src/vm/typeparse.h b/src/vm/typeparse.h index d56b8b0c3f..f242d71f31 100644 --- a/src/vm/typeparse.h +++ b/src/vm/typeparse.h @@ -79,6 +79,8 @@ public: WRAPPER_NO_CONTRACT; SString::Startup(); } + + virtual ~TypeNameFactory() {} private: DWORD m_count; @@ -310,7 +312,7 @@ public: parser.MakeRotorHappy(); } - ~TypeName(); + virtual ~TypeName(); public: #ifndef FEATURE_CORECLR diff --git a/src/vm/typestring.h b/src/vm/typestring.h index 0987fbfa44..7f60f932cc 100644 --- a/src/vm/typestring.h +++ b/src/vm/typestring.h @@ -174,7 +174,8 @@ public: virtual HRESULT __stdcall Clear(); TypeNameBuilderWrapper() : m_ref(0) { WRAPPER_NO_CONTRACT; } - + virtual ~TypeNameBuilderWrapper() {} + private: LONG m_ref; TypeNameBuilder m_tnb; diff --git a/src/zap/nativeformatwriter.h b/src/zap/nativeformatwriter.h index ef4a42e596..84c23bf4a6 100644 --- a/src/zap/nativeformatwriter.h +++ b/src/zap/nativeformatwriter.h @@ -47,6 +47,8 @@ namespace NativeFormat { } + virtual ~Vertex() {} + virtual void Save(NativeWriter * pWriter) = 0; int GetOffset() diff --git a/src/zap/zapimage.h b/src/zap/zapimage.h index 4ff0c41e5c..ea222a4f80 100644 --- a/src/zap/zapimage.h +++ b/src/zap/zapimage.h @@ -837,7 +837,7 @@ private: public: ZapImage(Zapper *zapper); - ~ZapImage(); + virtual ~ZapImage(); // ---------------------------------------------------------------------------------------------------------- // |