зеркало из https://github.com/mozilla/gecko-dev.git
Free pointer returned by GetTitle since it no longer returns a const pointer to the internal string storage.
This commit is contained in:
Родитель
596104f4a2
Коммит
39bf3b8c44
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче