Quantcast

[HtmlUnit] SVN: [14424] trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/ WebClient.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[HtmlUnit] SVN: [14424] trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/ WebClient.java

rbri
Revision: 14424
          http://sourceforge.net/p/htmlunit/code/14424
Author:   rbri
Date:     2017-05-10 13:22:21 +0000 (Wed, 10 May 2017)
Log Message:
-----------
take care to close all elements even if something fails

Modified Paths:
--------------
    trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java

Modified: trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java
===================================================================
--- trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java 2017-05-10 06:48:52 UTC (rev 14423)
+++ trunk/htmlunit/src/main/java/com/gargoylesoftware/htmlunit/WebClient.java 2017-05-10 13:22:21 UTC (rev 14424)
@@ -1858,7 +1858,12 @@
         final List<TopLevelWindow> topWindows = new ArrayList<>(topLevelWindows_);
         for (final TopLevelWindow topWindow : topWindows) {
             if (topLevelWindows_.contains(topWindow)) {
-                topWindow.close();
+                try {
+                    topWindow.close();
+                }
+                catch (final Exception e) {
+                    LOG.error("Exception while closing a topLevelWindow", e);
+                }
             }
         }
 
@@ -1865,7 +1870,12 @@
         // do this after closing the windows, otherwise some unload event might
         // start a new window that will start the thread again
         if (scriptEngine_ != null) {
-            scriptEngine_.shutdown();
+            try {
+                scriptEngine_.shutdown();
+            }
+            catch (final Exception e) {
+                LOG.error("Exception while shutdown the scriptEngine", e);
+            }
         }
 
         try {


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
HtmlUnit-develop mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/htmlunit-develop
Loading...