Bug 461621 - Crash in nsNNTPProtocol::~nsNNTPProtocol() on shutdown after Tb is left open for some time; r=Pidgeot18 sr=bienvenu
--- a/mailnews/news/src/nsNntpIncomingServer.cpp
+++ b/mailnews/news/src/nsNntpIncomingServer.cpp
@@ -438,17 +438,20 @@ nsNntpIncomingServer::CloseCachedConnect
PRInt32 cnt = mConnectionCache.Count();
for (PRInt32 i = 0; i < cnt; ++i)
{
connection = mConnectionCache[0];
if (connection)
{
rv = connection->CloseConnection();
- mConnectionCache.RemoveObjectAt(0);
+ // We need to do this instead of RemoveObjectAt(0) because the
+ // above call will likely cause the object to be removed from the
+ // array anyway
+ mConnectionCache.RemoveObject(connection);
}
}
rv = WriteNewsrcFile();
if (NS_FAILED(rv)) return rv;
if (!mGetOnlyNew && !mHostInfoLoaded)
{