void SVGSMILElement::disconnectEventBaseConditions() { for (unsigned n = 0; n < m_conditions.size(); ++n) { Condition* condition = m_conditions[n].get(); if (condition->getType() == Condition::EventBase) { ASSERT(!condition->syncBase()); if (!condition->eventListener()) continue; // Note: It's a memory optimization to try to remove our condition // event listener, but it's not guaranteed to work, since we have // no guarantee that eventBaseFor() will be able to find our condition's // original eventBase. So, we also have to disconnect ourselves from // our condition event listener, in case it later fires. SVGElement* eventBase = eventBaseFor(*condition); if (eventBase) eventBase->removeEventListener(AtomicString(condition->name()), condition->eventListener(), false); condition->eventListener()->disconnectAnimation(); condition->setEventListener(nullptr); } } }