diff --git a/src/SOS/Strike/strike.cpp b/src/SOS/Strike/strike.cpp index 91d46be707..2309e8173d 100644 --- a/src/SOS/Strike/strike.cpp +++ b/src/SOS/Strike/strike.cpp @@ -1317,7 +1317,7 @@ DECLARE_API(DumpMT) table.WriteRow("Entry", "MethodDesc", "JIT", "Slot", "Name"); - ISOSMethodEnum *pMethodEnumerator; + ToRelease pMethodEnumerator; if (SUCCEEDED(g_sos15->GetMethodTableSlotEnumerator(dwStartAddr, &pMethodEnumerator))) { SOSMethodData entry; diff --git a/src/SOS/Strike/util.cpp b/src/SOS/Strike/util.cpp index 30df0681e3..28d5c9b1cd 100644 --- a/src/SOS/Strike/util.cpp +++ b/src/SOS/Strike/util.cpp @@ -3644,7 +3644,7 @@ class SOSDacInterface15Simulator : public ISOSDacInterface15 unsigned int slotCount; ULONG refCount; public: - SOSMethodEnum(CLRDATA_ADDRESS mt) : pMT(mt), refCount(1) + SOSMethodEnum(CLRDATA_ADDRESS mt) : pMT(mt), refCount(0) { } @@ -3769,16 +3769,18 @@ class SOSDacInterface15Simulator : public ISOSDacInterface15 ISOSMethodEnum **enumerator) { SOSMethodEnum *simulator = new(std::nothrow) SOSMethodEnum(mt); - *enumerator = simulator; if (simulator == NULL) { return E_OUTOFMEMORY; } HRESULT hr = simulator->Reset(); + + if (SUCCEEDED(hr)) + hr = simulator->QueryInterface(__uuidof(ISOSMethodEnum), (void**)enumerator); + if (FAILED(hr)) - { - simulator->Release(); - } + delete simulator; + return hr; } } SOSDacInterface15Simulator_Instance; diff --git a/src/shared/inc/sospriv.idl b/src/shared/inc/sospriv.idl index 141f597dcb..ee768097ae 100644 --- a/src/shared/inc/sospriv.idl +++ b/src/shared/inc/sospriv.idl @@ -444,7 +444,7 @@ interface ISOSDacInterface8 : IUnknown // Increment anytime there is a change in the data structures that SOS depends on like // stress log structs (StressMsg, StressLogChunck, ThreadStressLog, etc), exception // stack traces (StackTraceElement), the PredefinedTlsSlots enums, etc. -cpp_quote("#define SOS_BREAKING_CHANGE_VERSION 5") +cpp_quote("#define SOS_BREAKING_CHANGE_VERSION 6") [ object, diff --git a/src/shared/pal/prebuilt/inc/sospriv.h b/src/shared/pal/prebuilt/inc/sospriv.h index 4ff12d95b7..360d714938 100644 --- a/src/shared/pal/prebuilt/inc/sospriv.h +++ b/src/shared/pal/prebuilt/inc/sospriv.h @@ -2802,7 +2802,7 @@ EXTERN_C const IID IID_ISOSDacInterface8; /* interface __MIDL_itf_sospriv_0000_0012 */ /* [local] */ -#define SOS_BREAKING_CHANGE_VERSION 5 +#define SOS_BREAKING_CHANGE_VERSION 6 extern RPC_IF_HANDLE __MIDL_itf_sospriv_0000_0012_v0_0_c_ifspec;