Use a cleanup method that is explicitly invoked instead of the finalize() method.
protected void free() {
getApplet().destroy();
}
private Applet getApplet() {
if (_applet == null) {
_applet = new Applet();
}
return _applet;
}
private Applet _applet = null;
|
|