Closed GoogleCodeExporter closed 9 years ago
Hi,
All timers (including the one responsible for this exception) are cancelled
whenever the player widget is unloaded. If the layout calls 'onUnload' on all
child widgets then this exception would not be raised.
How does your layout handle its child widgets when it is closed?
Original comment by sbrah...@gmail.com
on 14 Jan 2013 at 10:49
I am not sure.
I am using SmartGWT layouts this way:
final AbstractMediaPlayer player = new VLCPlayer (...);
final VLayout layout = new VLayout ();
layout.addMember (player);
Note, that VLayout.addMember () does the following, which wraps the
AbstractMediaPlayer within a WidgetCanvas:
public void addMember(Widget widget) {
if (widget instanceof Canvas) {
addMember((Canvas) widget);
} else {
addMember(new WidgetCanvas(widget));
}
}
I can definitely ask the SmartGWT guys and see what they say.
Meanwhile, you say that the timers are cancelled when the player widget
receives an onUnload () invocation, but how does the timer cancel happen? I do
not see any timer canceling nor unload () in AbstractMediaPlayer (version 1.3).
Original comment by shortpa...@gmail.com
on 15 Jan 2013 at 7:17
The timer you referenced in your post is not the cause of this exception. That
timer run only once and gets gc'ed eventually.
The timer concerned in this is in
com.bramosystems.oss.player.core.client.skin.CustomPlayerControl, which is
cancelled when the player widget is unloaded.
Original comment by sbrah...@gmail.com
on 23 Jan 2013 at 3:56
I reference 2 timers:
1. CustomPlayerControl, which I get every 1000 milliseconds after the player
goes away from the screen, and
2. AbstractMediaPlayer, as an example of where a timer is created but not
explicitly destroyed
In case #1, the timer gets cancelled when the player is unloaded, so it must
mean that the player is not getting unloaded in my case. Other than changing
the player reference to null, do you know if there is a way to force the unload
or destroy of the player? This might even be a SmartGWT side-effect, and I am
happy to continue testing things and push to them if it's something that they
can address -- they are pretty good about fixing things... This would mean that
your player could have an additional audience: the smartgwt developers. Because
in the meantime, the exceptions that popup every second render the gwt log
unreadable...
In case #2, as I said in my original post, I was just giving you an example of
where the timer is not explicitly destroyed. Follow-up question (just
curiosity), why are you using a timer with a delay of 500 and not a GWT
deferred command, for example -- does that run too quickly?
final Scheduler scheduler = Scheduler.get ();
scheduler.scheduleDeferred (new Scheduler.ScheduledCommand() {
public void execute() {
...
}
});
Original comment by shortpa...@gmail.com
on 23 Jan 2013 at 5:42
Original issue reported on code.google.com by
shortpa...@gmail.com
on 8 Jan 2013 at 3:35