MCPcopy Index your code
hub / github.com/HtmlUnit/htmlunit / cleanUp

Method cleanUp

src/main/java/org/htmlunit/html/HtmlPage.java:354–381  ·  view source on GitHub ↗

Clean up this page.

()

Source from the content-addressed store, hash-verified

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}

Callers 2

addAutoCloseableMethod · 0.95
addAutoCloseableNullMethod · 0.95

Calls 5

cleanUpMethod · 0.65
closeMethod · 0.65
errorMethod · 0.65

Tested by 2

addAutoCloseableMethod · 0.76
addAutoCloseableNullMethod · 0.76