Clean up this page.
()
| 352 | * Clean up this page. |
| 353 | */ |
| 354 | @Override |
| 355 | public void cleanUp() { |
| 356 | //To avoid endless recursion caused by window.close() in onUnload |
| 357 | if (cleaning_) { |
| 358 | return; |
| 359 | } |
| 360 | |
| 361 | cleaning_ = true; |
| 362 | try { |
| 363 | super.cleanUp(); |
| 364 | executeEventHandlersIfNeeded(Event.TYPE_UNLOAD); |
| 365 | deregisterFramesIfNeeded(); |
| 366 | } |
| 367 | finally { |
| 368 | cleaning_ = false; |
| 369 | |
| 370 | if (autoCloseableList_ != null) { |
| 371 | for (final AutoCloseable closeable : new ArrayList<>(autoCloseableList_)) { |
| 372 | try { |
| 373 | closeable.close(); |
| 374 | } |
| 375 | catch (final Exception e) { |
| 376 | LOG.error("Closing the autoclosable " + closeable + " failed", e); |
| 377 | } |
| 378 | } |
| 379 | } |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | /** |
| 384 | * {@inheritDoc} |