Fixed some serious ref count bugs using nsIURL when instantiating plugins.

This commit is contained in:
beard%netscape.com 1999-05-14 22:45:46 +00:00
Родитель 12ad2b00ee
Коммит cadbc9037b
2 изменённых файлов: 18 добавлений и 12 удалений

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

@ -789,6 +789,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
if(!fullURL && baseURL) {
SetFullURL(baseURL);
fullURL = baseURL;
NS_IF_ADDREF(fullURL);
}
nsIView *parentWithView;
nsPoint origin;
@ -886,7 +887,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
nsIPluginHost *pluginHost = nsnull;
nsIContentViewerContainer *cv = nsnull;
nsIURL* baseURL = nsnull;
nsIURL* fullURL = nsnull;
nsIURL* fullURL = nsnull;
nsAutoString classid;
PRInt32 nameSpaceID;
@ -938,7 +939,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
else
{
fullURL = baseURL;
NS_ADDREF(fullURL);
NS_IF_ADDREF(fullURL);
}
NS_IF_RELEASE(group);
@ -1000,9 +1001,10 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
NS_IF_RELEASE(baseURL);
baseURL = codeBaseURL;
}
}
else
} else {
fullURL = baseURL;
NS_IF_ADDREF(fullURL);
}
NS_IF_RELEASE(group);
@ -1140,9 +1142,10 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
// Create an absolute URL
rv = NS_NewURL(&fullURL, src, baseURL, nsnull, group);
NS_IF_RELEASE(group);
}
else // we didn't find a src or data param, so just set the url to the base
} else {// we didn't find a src or data param, so just set the url to the base
fullURL = baseURL;
NS_IF_ADDREF(fullURL);
}
// if we didn't find the type, but we do have a src, we can determine the mimetype
// based on the file extension

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

@ -789,6 +789,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
if(!fullURL && baseURL) {
SetFullURL(baseURL);
fullURL = baseURL;
NS_IF_ADDREF(fullURL);
}
nsIView *parentWithView;
nsPoint origin;
@ -886,7 +887,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
nsIPluginHost *pluginHost = nsnull;
nsIContentViewerContainer *cv = nsnull;
nsIURL* baseURL = nsnull;
nsIURL* fullURL = nsnull;
nsIURL* fullURL = nsnull;
nsAutoString classid;
PRInt32 nameSpaceID;
@ -938,7 +939,7 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
else
{
fullURL = baseURL;
NS_ADDREF(fullURL);
NS_IF_ADDREF(fullURL);
}
NS_IF_RELEASE(group);
@ -1000,9 +1001,10 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
NS_IF_RELEASE(baseURL);
baseURL = codeBaseURL;
}
}
else
} else {
fullURL = baseURL;
NS_IF_ADDREF(fullURL);
}
NS_IF_RELEASE(group);
@ -1140,9 +1142,10 @@ nsObjectFrame::Reflow(nsIPresContext& aPresContext,
// Create an absolute URL
rv = NS_NewURL(&fullURL, src, baseURL, nsnull, group);
NS_IF_RELEASE(group);
}
else // we didn't find a src or data param, so just set the url to the base
} else {// we didn't find a src or data param, so just set the url to the base
fullURL = baseURL;
NS_IF_ADDREF(fullURL);
}
// if we didn't find the type, but we do have a src, we can determine the mimetype
// based on the file extension