Fix bug #81926. Crashes in factory constructor when starting a drag on linux. r=naving, sr=sspitzer

This commit is contained in:
blizzard%redhat.com 2001-05-21 22:21:39 +00:00
Родитель 7476453f28
Коммит d308eaff8b
1 изменённых файлов: 5 добавлений и 1 удалений

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

@ -77,9 +77,10 @@ static NS_IMETHODIMP nsScriptableRegionConstructor(nsISupports *aOuter, REFNSIID
// create an nsRegionGtk and get the scriptable region from it
nsCOMPtr <nsIRegion> rgn;
NS_NEWXPCOM(rgn, nsRegionGTK);
nsCOMPtr<nsIScriptableRegion> scriptableRgn;
if (rgn != nsnull)
{
nsCOMPtr<nsIScriptableRegion> scriptableRgn = new nsScriptableRegion(rgn);
scriptableRgn = new nsScriptableRegion(rgn);
inst = scriptableRgn;
}
if (!inst)
@ -88,6 +89,9 @@ static NS_IMETHODIMP nsScriptableRegionConstructor(nsISupports *aOuter, REFNSIID
return rv;
}
NS_ADDREF(inst);
// release our variable above now that we have created our owning
// reference - we don't want this to go out of scope early!
scriptableRgn = nsnull;
rv = inst->QueryInterface(aIID, aResult);
NS_RELEASE(inst);