ns4xPluginInstance *inst = mInst; if(inst) { nsInstanceStream * prev = nsnull; for(nsInstanceStream *is = inst->mStreams; is != nsnull; is = is->mNext) { if(is->mPluginStreamListener == this) { if(prev == nsnull) inst->mStreams = is->mNext; else prev->mNext = is->mNext;  delete is; break; } prev = is; } }     CallURLNotify(NPRES_NETWORK_ERR);   if (mStreamBuffer) { PR_Free(mStreamBuffer); mStreamBuffer=nsnull; }   NS_IF_RELEASE(inst);  if (mNotifyURL) PL_strfree(mNotifyURL);
NS_IF_RELEASE(mInst);
ns4xPluginStreamListener::~ns4xPluginStreamListener(void){  // remove itself from the instance stream list  ns4xPluginInstance *inst = mInst;  if(inst) {    nsInstanceStream * prev = nsnull;    for(nsInstanceStream *is = inst->mStreams; is != nsnull; is = is->mNext) {      if(is->mPluginStreamListener == this) {        if(prev == nsnull)          inst->mStreams = is->mNext;        else          prev->mNext = is->mNext;        delete is;        break;      }      prev = is;    }  }  // For those cases when NewStream is never called, we still may need to fire a  // notification callback. Return network error as fallback reason because for other  // cases, notify should have already been called for other reasons elsewhere.  CallURLNotify(NPRES_NETWORK_ERR);  // lets get rid of the buffer  if (mStreamBuffer)  {    PR_Free(mStreamBuffer);    mStreamBuffer=nsnull;  }  NS_IF_RELEASE(inst);  if (mNotifyURL)    PL_strfree(mNotifyURL);}