You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener#Me
mory_issues
public final native void registerMediaStateHandler(NativeEventCallback _callback) /*-{
this.addEventListener('progress', function(){ // plugin init complete
_callback.@com.ritmos.web.ui.common.client.media.NativeEventCallback::onProgressChanged()();
}, false);
this.addEventListener('play', function(){ // play started
_callback.@com.ritmos.web.ui.common.client.media.NativeEventCallback::onStateChanged(I)(1);
}, false);
......
Will likely produce memory issues.
Original issue reported on code.google.com by ciberki...@gmail.com on 30 Apr 2014 at 11:25
The text was updated successfully, but these errors were encountered:
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
Original issue reported on code.google.com by
ciberki...@gmail.com
on 30 Apr 2014 at 11:25The text was updated successfully, but these errors were encountered: