virtual ~nsInputStreamReadyEvent()
~nsInputStreamReadyEvent()
    virtual ~nsInputStreamReadyEvent()    {        if (mCallback) {            nsresult rv;            //            // whoa!!  looks like we never posted this event.  take care to            // release mCallback on the correct thread.  if mTarget lives on the            // calling thread, then we are ok.  otherwise, we have to try to             // proxy the Release over the right thread.  if that thread is dead,            // then there's nothing we can do... better to leak than crash.            //            PRBool val;            rv = mTarget->IsOnCurrentThread(&val);            if (NS_FAILED(rv) || !val) {                nsCOMPtr<nsIInputStreamCallback> event;                NS_NewInputStreamReadyEvent(getter_AddRefs(event), mCallback, mTarget);                mCallback = 0;                if (event) {                    rv = event->OnInputStreamReady(nsnull);                    if (NS_FAILED(rv)) {                        NS_NOTREACHED("leaking stream event");                        nsISupports *sup = event;                        NS_ADDREF(sup);                    }                }            }        }    }