Bug 788275 - Part 0: Make nsCORSListenerProxy's constructor not cause the object to be destroyed before it is constructed; r=bzbarsky
That is always a nice property to have!
This commit is contained in:
@@ -485,10 +485,9 @@ txCompileObserver::startLoad(nsIURI* aUri, txStylesheetCompiler* aCompiler,
|
||||
parser->Parse(aUri);
|
||||
|
||||
// Always install in case of redirects
|
||||
nsCOMPtr<nsIStreamListener> listener =
|
||||
new nsCORSListenerProxy(sink, aReferrerPrincipal, channel,
|
||||
false, &rv);
|
||||
NS_ENSURE_TRUE(listener, NS_ERROR_OUT_OF_MEMORY);
|
||||
nsRefPtr<nsCORSListenerProxy> listener =
|
||||
new nsCORSListenerProxy(sink, aReferrerPrincipal, false);
|
||||
rv = listener->Init(channel);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
return channel->AsyncOpen(listener, parser);
|
||||
|
||||
Reference in New Issue
Block a user