зеркало из https://github.com/mozilla/pjs.git
Fix incorrect use of nsSupportsHashTable that was causing leakage.
This commit is contained in:
Родитель
0eb37c639b
Коммит
faa4cf33a1
|
@ -478,12 +478,10 @@ NS_IMETHODIMP nsChromeRegistry::GetOverlayDataSource(nsIURI *aChromeURL, nsIRDFD
|
||||||
overlayFile += "overlays.rdf";
|
overlayFile += "overlays.rdf";
|
||||||
|
|
||||||
nsStringKey skey(overlayFile);
|
nsStringKey skey(overlayFile);
|
||||||
void *data = mDataSourceTable->Get(&skey);
|
nsCOMPtr<nsISupports> supports = getter_AddRefs(NS_STATIC_CAST(nsISupports*, mDataSourceTable->Get(&skey)));
|
||||||
if (data)
|
if (supports)
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIRDFDataSource> dataSource;
|
nsCOMPtr<nsIRDFDataSource> dataSource = do_QueryInterface(supports, &rv);
|
||||||
nsISupports *supports = NS_STATIC_CAST(nsISupports*, data);
|
|
||||||
dataSource = do_QueryInterface(supports, &rv);
|
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
{
|
{
|
||||||
*aResult = dataSource;
|
*aResult = dataSource;
|
||||||
|
@ -600,13 +598,10 @@ nsChromeRegistry::InitializeDataSource(nsString &aPackage,
|
||||||
{
|
{
|
||||||
// current.rdf and overlays.rdf are loaded in pairs and so if one is loaded, the other should be too.
|
// current.rdf and overlays.rdf are loaded in pairs and so if one is loaded, the other should be too.
|
||||||
nsStringKey skey(chromeFile);
|
nsStringKey skey(chromeFile);
|
||||||
void *data = mDataSourceTable->Get(&skey);
|
nsCOMPtr<nsISupports> supports = getter_AddRefs(NS_STATIC_CAST(nsISupports*, mDataSourceTable->Get(&skey)));
|
||||||
if (data)
|
if (supports)
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIRDFDataSource> dataSource;
|
nsCOMPtr<nsIRDFDataSource> dataSource = do_QueryInterface(supports);
|
||||||
nsISupports *supports = NS_STATIC_CAST(nsISupports*, data);
|
|
||||||
|
|
||||||
dataSource = do_QueryInterface(supports);
|
|
||||||
if (dataSource)
|
if (dataSource)
|
||||||
{
|
{
|
||||||
*aResult = dataSource;
|
*aResult = dataSource;
|
||||||
|
|
|
@ -478,12 +478,10 @@ NS_IMETHODIMP nsChromeRegistry::GetOverlayDataSource(nsIURI *aChromeURL, nsIRDFD
|
||||||
overlayFile += "overlays.rdf";
|
overlayFile += "overlays.rdf";
|
||||||
|
|
||||||
nsStringKey skey(overlayFile);
|
nsStringKey skey(overlayFile);
|
||||||
void *data = mDataSourceTable->Get(&skey);
|
nsCOMPtr<nsISupports> supports = getter_AddRefs(NS_STATIC_CAST(nsISupports*, mDataSourceTable->Get(&skey)));
|
||||||
if (data)
|
if (supports)
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIRDFDataSource> dataSource;
|
nsCOMPtr<nsIRDFDataSource> dataSource = do_QueryInterface(supports, &rv);
|
||||||
nsISupports *supports = NS_STATIC_CAST(nsISupports*, data);
|
|
||||||
dataSource = do_QueryInterface(supports, &rv);
|
|
||||||
if (NS_SUCCEEDED(rv))
|
if (NS_SUCCEEDED(rv))
|
||||||
{
|
{
|
||||||
*aResult = dataSource;
|
*aResult = dataSource;
|
||||||
|
@ -600,13 +598,10 @@ nsChromeRegistry::InitializeDataSource(nsString &aPackage,
|
||||||
{
|
{
|
||||||
// current.rdf and overlays.rdf are loaded in pairs and so if one is loaded, the other should be too.
|
// current.rdf and overlays.rdf are loaded in pairs and so if one is loaded, the other should be too.
|
||||||
nsStringKey skey(chromeFile);
|
nsStringKey skey(chromeFile);
|
||||||
void *data = mDataSourceTable->Get(&skey);
|
nsCOMPtr<nsISupports> supports = getter_AddRefs(NS_STATIC_CAST(nsISupports*, mDataSourceTable->Get(&skey)));
|
||||||
if (data)
|
if (supports)
|
||||||
{
|
{
|
||||||
nsCOMPtr<nsIRDFDataSource> dataSource;
|
nsCOMPtr<nsIRDFDataSource> dataSource = do_QueryInterface(supports);
|
||||||
nsISupports *supports = NS_STATIC_CAST(nsISupports*, data);
|
|
||||||
|
|
||||||
dataSource = do_QueryInterface(supports);
|
|
||||||
if (dataSource)
|
if (dataSource)
|
||||||
{
|
{
|
||||||
*aResult = dataSource;
|
*aResult = dataSource;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче