mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 04:15:43 +00:00
Bug 1150049 - tidy up nsImageBoxFrame::Init a little bit; r=dholbert
We don't need to use manual NS_{ADDREF,RELEASE} here when nsRefPtr will do that for us. The manual QueryInterface invocation only serves to do an expensive static_cast and increase the refcount; we can forget our reference into mListener to achieve the same effect.
This commit is contained in:
parent
d7b5eebe96
commit
8bef8d02b7
@ -192,11 +192,9 @@ nsImageBoxFrame::Init(nsIContent* aContent,
|
||||
nsIFrame* aPrevInFlow)
|
||||
{
|
||||
if (!mListener) {
|
||||
nsImageBoxListener *listener = new nsImageBoxListener();
|
||||
NS_ADDREF(listener);
|
||||
nsRefPtr<nsImageBoxListener> listener = new nsImageBoxListener();
|
||||
listener->SetFrame(this);
|
||||
listener->QueryInterface(NS_GET_IID(imgINotificationObserver), getter_AddRefs(mListener));
|
||||
NS_RELEASE(listener);
|
||||
mListener = listener.forget();
|
||||
}
|
||||
|
||||
mSuppressStyleCheck = true;
|
||||
|
Loading…
Reference in New Issue
Block a user