Skip to content

Commit

Permalink
JSFUNIT-275 Change to call closeAllWindows on SessionUnBound
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.jboss.org/repos/jsfunit/trunk@574 992343fe-802f-0410-85da-d31fbad5f0a6
  • Loading branch information
aslakknutsen committed Apr 5, 2011
1 parent dc06ac2 commit 8ebbb2b
Showing 1 changed file with 1 addition and 17 deletions.
Expand Up @@ -291,23 +291,7 @@ public void valueUnbound(HttpSessionBindingEvent httpSessionBindingEvent)
// as per HtmlUnit issue:
// https://sourceforge.net/tracker/?func=detail&atid=448266&aid=2014629&group_id=47038
// -----------------------------------------------------------------------------------

// first get the top windows and then close them to avoid ConcurrentModificationException
final List<TopLevelWindow> topWindows = new ArrayList<TopLevelWindow>();
for (final Iterator<WebWindow> iter=webClient.getWebWindows().iterator();iter.hasNext();)
{
final WebWindow window = iter.next();
if (window instanceof TopLevelWindow)
{
topWindows.add((TopLevelWindow)window);
}
}
for (final Iterator<TopLevelWindow> iter=topWindows.iterator(); iter.hasNext();)
{
final TopLevelWindow window = iter.next();
window.close();
}

webClient.closeAllWindows();
}

public void valueBound(HttpSessionBindingEvent httpSessionBindingEvent)
Expand Down

0 comments on commit 8ebbb2b

Please sign in to comment.