void gf_dom_listener_reset_deferred(GF_SceneGraph *sg)
{
	gf_mx_p(sg->dom_evt_mx);
	while (gf_list_count(sg->listeners_to_add)) {
		DOMAddListener *l = (DOMAddListener *)gf_list_get(sg->listeners_to_add, 0);
		gf_list_rem(sg->listeners_to_add, 0);
		gf_free(l);
	}
	gf_mx_v(sg->dom_evt_mx);
}
void gf_dom_listener_reset_deferred(GF_SceneGraph *sg)
{
	gf_mx_p(sg->dom_evt_mx);
	while (gf_list_count(sg->listeners_to_add)) {
		DOMAddListener *l = (DOMAddListener *)gf_list_get(sg->listeners_to_add, 0);
		gf_list_rem(sg->listeners_to_add, 0);
		gf_free(l);
	}
	gf_mx_v(sg->dom_evt_mx);
}