NS_ADDREF(event);
nsISupports *sup = event; NS_ADDREF(sup);
    virtual ~nsInputStreamReadyEvent()    {        if (mNotify) {            //            // whoa!! looks like we never posted this event. take care not to            // delete mNotify on the calling thread (which might be the wrong            // thread).            //            nsCOMPtr<nsIInputStreamNotify> event;            NS_NewInputStreamReadyEvent(getter_AddRefs(event), mNotify, mEventQ);            mNotify = 0;            if (event) {                nsresult rv = event->OnInputStreamReady(nsnull);                if (NS_FAILED(rv)) {                    // PostEvent failed, we must be shutting down.  better to                    // leak than crash!                    NS_NOTREACHED("leaking stream event");                    NS_ADDREF(event);                }            }        }    }