Damien O'Brien wrote:
nsIDOMWindow *wind = NULL; wwatch->GetActiveWindow(&wind);

FWIW, you are leaking the window here.

Can I ask one other question - you say above that I'm leaking the window in this piece of code - do you mean leaking memory? If so is the right thing to do to use something like nsMemory::Free to clean this up once I'm done using this pointer?


Yes, it's a memory leak. The right thing is to NS_RELEASE the pointer when you're done with it; even better would be using nsCOMPtr:

  nsCOMPtr<nsIDOMWindow> wind;
  wwatch->GetActiveWindow(getter_AddRefs(wind));

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature



Reply via email to