if (mImageResizingEnabled) { nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(mImageContent); target->RemoveEventListener(NS_LITERAL_STRING("click"), this, PR_FALSE);
if (mImageContent) {  if (mImageResizingEnabled) { nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(mImageContent); target->RemoveEventListener(NS_LITERAL_STRING("click"), this, PR_FALSE); }   nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mImageContent); if (imageLoader) { imageLoader->RemoveObserver(this); }  mImageContent = nsnull;
nsImageDocument::Destroy(){  // Remove our event listener from the image content.  if (mImageResizingEnabled) {    nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(mImageContent);    target->RemoveEventListener(NS_LITERAL_STRING("click"), this, PR_FALSE);  }  // Break reference cycle with mImageContent, if we have one  nsCOMPtr<nsIImageLoadingContent> imageLoader = do_QueryInterface(mImageContent);  if (imageLoader) {    imageLoader->RemoveObserver(this);  }  mImageContent = nsnull;  nsMediaDocument::Destroy();}