Jacek Caban (@jacek) commented about dlls/mshtml/nsevents.c:
nsres = nsIDOMEventTarget_QueryInterface(event_target, &IID_nsIDOMNode, (void**)&nsnode); nsIDOMEventTarget_Release(event_target); if(NS_FAILED(nsres)) {
ERR("Could not get nsIDOMNode: %08lx\n", nsres);
return NS_OK;
if(!doc->window)
return S_OK;
target = &doc->window->event_target;
Grabbing window reference here would be reasonable and would allow the rest of the code to unconditionally release it.