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

Fixing memory leak when converting to PyObject from some SAFEARRAY elements #2316

Merged
merged 1 commit into from
Oct 18, 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
6 changes: 3 additions & 3 deletions com/win32com/src/oleargs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -860,15 +860,15 @@ static PyObject *PyCom_PyObjectFromSAFEARRAYDimensionItem(SAFEARRAY *psa, VARENU
hres = SafeArrayGetElement(psa, arrayIndices, &str);
if (FAILED(hres))
break;
subitem = PyWinObject_FromBstr(str);
subitem = PyWinObject_FromBstr(str, TRUE);
break;
}
case VT_DISPATCH: {
IDispatch *pDisp;
hres = SafeArrayGetElement(psa, arrayIndices, &pDisp);
if (FAILED(hres))
break;
subitem = PyCom_PyObjectFromIUnknown(pDisp, IID_IDispatch, TRUE);
subitem = PyCom_PyObjectFromIUnknown(pDisp, IID_IDispatch, FALSE);
break;
}
// case VT_ERROR - handled above with I4
Expand All @@ -895,7 +895,7 @@ static PyObject *PyCom_PyObjectFromSAFEARRAYDimensionItem(SAFEARRAY *psa, VARENU
hres = SafeArrayGetElement(psa, arrayIndices, &pUnk);
if (FAILED(hres))
break;
subitem = PyCom_PyObjectFromIUnknown(pUnk, IID_IUnknown, TRUE);
subitem = PyCom_PyObjectFromIUnknown(pUnk, IID_IUnknown, FALSE);
break;
}
// case VT_DECIMAL
Expand Down
Loading