This patch fixes #4711. The problem here is that the browser sometimes will shutdown some of our exploit's connections (in my testing, all Java), and that will cause Ruby to call a rb_sys_fail with "getpeername(2)". The error goes all the way to Rex::IO::StreamServer's monitor_listener method, which triggers a "break" to quit monitoring. And then this causes another chain of reactions that eventually forces BrowserAutoPwn to quit completely (while the JavaScript on the browser is still running)
Metasploit

The Metasploit Framework is released under a BSD-style license. See COPYING for more details.
The latest version of this software is available from https://metasploit.com/
Bug tracking and development information can be found at: https://github.com/rapid7/metasploit-framework
New bugs and feature requests should be directed to: http://r-7.co/MSF-BUGv1
API documentation for writing modules can be found at: https://rapid7.github.io/metasploit-framework/api
Questions and suggestions can be sent to: https://lists.sourceforge.net/lists/listinfo/metasploit-hackers
Installing
Generally, you should use the free installer which contains all dependencies and will get you up and running with a few clicks. See the Dev Environment Setup if you'd like to deal with dependencies on your own.
Using Metasploit
Metasploit can do all sorts of things. The first thing you'll want to do
is start msfconsole, but after that, you'll probably be best served by
reading Metasploit Unleashed, the great community
resources, or the wiki.
Contributing
See the Dev Environment Setup guide on GitHub which will walk you through the whole process starting from installing all the dependencies, to cloning the repository, and finally to submitting a pull request. For slightly more info, see Contributing.