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

Change ICorProfilerMethodEnum to use the COMPtr #6334

Merged
merged 3 commits into from
Nov 22, 2024
Merged
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
7 changes: 3 additions & 4 deletions tracer/src/Datadog.Tracer.Native/rejit_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ bool RejitHandlerModuleMethod::RequestRejitForInlinersInModule(ModuleID moduleId
{
// Now we enumerate all methods that inline the current methodDef
BOOL incompleteData = false;
ICorProfilerMethodEnum* methodEnum;
ComPtr<ICorProfilerMethodEnum> methodEnum;

HRESULT hr = pInfo->EnumNgenModuleMethodsInliningThisMethod(moduleId, currentModuleId, currentMethodDef,
&incompleteData, &methodEnum);
&incompleteData, methodEnum.GetAddressOf());
std::ostringstream hexValue;
hexValue << std::hex << hr;
if (SUCCEEDED(hr))
Expand All @@ -82,8 +82,7 @@ bool RejitHandlerModuleMethod::RequestRejitForInlinersInModule(ModuleID moduleId
methods.push_back(method.methodId);
total++;
}
methodEnum->Release();
methodEnum = nullptr;

if (total > 0)
{
handler->EnqueueForRejit(modules, methods);
Expand Down
Loading