mongodb/node-mongodb-native — pull request #706 by elbert3 (2012-09-10 18:38:29+00:00)
Title: Fixed connection leaks

I was seeing the number of connections between my client and mongodb replica set grow continuously over time even though I was closing the db connections after using them. Eventually, this was causing crashes on both the client and mongodb servers.

After investigating, I made the following changes to the driver, which seems to have fixed the issue:
* Close existing connection (if any) before reassigning server reference
* Fix how servers are iterated over when closing