NS_RELEASE(aListener);
NS_RELEASE(ifaceListener);
static nsresult DispatchToInterface(nsIDOMEvent* aEvent,                                    nsIDOMEventListener* aListener,                                    GenericHandler aMethod,                                    const nsIID& aIID,                                    PRBool* aHasInterface){  nsIDOMEventListener* ifaceListener = nsnull;  nsresult rv = NS_OK;  aListener->QueryInterface(aIID, (void**) &ifaceListener);  if (ifaceListener) {    *aHasInterface = PR_TRUE;    rv = (ifaceListener->*aMethod)(aEvent);    NS_RELEASE(aListener);  }  return rv;}