Free pointer returned by GetTitle since it no longer returns a const pointer to the internal string storage.

This commit is contained in:
tbogard%aol.net 1999-11-27 02:29:17 +00:00
Родитель 596104f4a2
Коммит 39bf3b8c44
1 изменённых файлов: 4 добавлений и 4 удалений

Просмотреть файл

@ -1858,16 +1858,16 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::get_LocationName(BSTR __RPC_FAR *Loca
}
// Get the url from the web shell
const PRUnichar *pszLocationName = nsnull;
m_pIWebShell->GetTitle(&pszLocationName);
if (pszLocationName == nsnull)
nsXPIDLString locationName;
m_pIWebShell->GetTitle(getter_Copies(locationName));
if (locationName == nsnull)
{
RETURN_E_UNEXPECTED();
}
// Convert the string to a BSTR
USES_CONVERSION;
LPOLESTR pszConvertedLocationName = W2OLE(const_cast<PRUnichar *>(pszLocationName));
LPOLESTR pszConvertedLocationName = W2OLE(const_cast<PRUnichar *>(locationName));
*LocationName = SysAllocString(pszConvertedLocationName);
return S_OK;