Fix for bug 362162: copy image to other app and crash on exit

r+sr=pavlov
This commit is contained in:
emaijala%kolumbus.fi 2006-12-03 10:10:30 +00:00
parent 316c1997d8
commit ae0091f3b4

View File

@ -1076,7 +1076,7 @@ HRESULT nsDataObj::GetPreferredDropEffect ( FORMATETC& aFE, STGMEDIUM& aSTG )
//-----------------------------------------------------
HRESULT nsDataObj::GetText(const nsACString & aDataFlavor, FORMATETC& aFE, STGMEDIUM& aSTG)
{
void* data;
void* data = NULL;
PRUint32 len;
// if someone asks for text/plain, look up text/unicode instead in the transferable.
@ -1093,6 +1093,9 @@ HRESULT nsDataObj::GetText(const nsACString & aDataFlavor, FORMATETC& aFE, STGME
if ( !len )
return ResultFromScode(E_FAIL);
nsPrimitiveHelpers::CreateDataFromPrimitive ( flavorStr, genericDataWrapper, &data, len );
if ( !data )
return ResultFromScode(E_FAIL);
HGLOBAL hGlobalMemory = NULL;
aSTG.tymed = TYMED_HGLOBAL;