请问string到BSTR的转换为什么会内存泄露
bool CPageParse::getElementValue(LPCTSTR name, string& value)
{
IHTMLElement* pElem = getElement(name);
if (pElem)
{
IHTMLInputElement* pInput;
pElem->QueryInterface(IID_IHTMLInputElement,(LPVOID*)&pInput);
if (pInput)
{
BSTR szValue = NULL;
pInput->get_value(&szValue);
if (szValue)
value = _com_util::ConvertBSTRToString(szValue); // 有了这句的话 程序关闭时未完全退出
::SysFreeString(szValue);
pInput->Release();
}
pElem->Release();
}
return true;
}