/// Releases all allocated listeners void ReleaseListeners() { for( listenerList::iterator it = listeners.begin(); it != listeners.end(); ++it ) { __delete__( *it ); } listeners.clear(); }
/// Releases pointers to AS functions held by allocated listeners void ReleaseListnersFunctions() { listenerList::iterator it; for( it = listeners.begin(); it != listeners.end(); ++it ) { (*it)->releaseFunctionPtr(); } }
void GarbageCollect( void ) { for( listenerList::iterator it = listeners.begin(); it != listeners.end(); ) { ScriptEventListener *listener = *it; if( !listener->isValid() ) { it = listeners.erase( it ); __delete__( listener ); continue; } ++it; } }
virtual Rocket::Core::EventListener* InstanceEventListener( const String& value, Element *elem ) { if( !value.Length() ) { return 0; } ScriptEventListener *listener = __new__( ScriptEventListener )( value, idCounter++, elem ); listeners.push_back( listener ); return listener; }