/** * Cleanup page resources. * * @see org.fujion.component.BaseComponent#onDestroy() */ @Override protected void onDestroy() { super.onDestroy(); PageRegistry.unregisterPage(this); if (session != null) { synchronizer.clear(); eventQueue.clearAll(); callbacks.clear(); session = null; } }
/** * Destroys this component. */ public void destroy() { if (dead) { return; } onDestroy(); if (page != null) { page.registerComponent(this, false); } destroyChildren(); if (parent != null) { parent.children.remove(this, false, true); } else { invokeIfAttached("destroy"); } dead = true; fireEvent(new Event("destroy", this)); eventListeners.removeAll(); }