Open GoogleCodeExporter opened 9 years ago
I suggest assigning the listeners to class members so they can be removed when
detached
Original comment by ciberki...@gmail.com
on 30 Apr 2014 at 11:27
You want something that looks like this:
public final native void releaseMediaStateHandler()
/*-{
this.removeEventListener('loadstart', this.progressListener);
}-*/;
public final native void registerMediaStateHandler(NativeEventCallback _callback)
/*-{
this.progressListener = function(){ // plugin init complete
_callback.@com.ritmos.web.ui.common.client.media.NativeEventCallback::onProgressChanged()();
};
this.addEventListener('loadstart', this.progressListener, false);
And make sure that releaseMediaStateHandler is called onDetach ;)
Original comment by ciberki...@gmail.com
on 30 Apr 2014 at 1:22
Obviestly change com.ritmos.web.ui.common.client.media with
correct package!
Original comment by ciberki...@gmail.com
on 30 Apr 2014 at 1:23
Original comment by sbrah...@gmail.com
on 9 May 2014 at 5:14
Original issue reported on code.google.com by
ciberki...@gmail.com
on 30 Apr 2014 at 11:25