From bf39c1069e6b0b6bd6c18d0a8c48ab5ecf07f7ab Mon Sep 17 00:00:00 2001 From: "darin%netscape.com" Date: Wed, 15 May 2002 03:07:14 +0000 Subject: [PATCH] fixes bug 143821 "Trunk M1RC2 crashes with bad connection [@ nsHttpHandler::ReclaimConnection]" r=kaie sr=jag --- netwerk/protocol/http/src/nsHttpConnection.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/netwerk/protocol/http/src/nsHttpConnection.cpp b/netwerk/protocol/http/src/nsHttpConnection.cpp index 253d10008562..e806dd156e74 100644 --- a/netwerk/protocol/http/src/nsHttpConnection.cpp +++ b/netwerk/protocol/http/src/nsHttpConnection.cpp @@ -64,6 +64,10 @@ nsHttpConnection::nsHttpConnection() LOG(("Creating nsHttpConnection @%x\n", this)); NS_INIT_ISUPPORTS(); + + // grab a reference to the handler to ensure that it doesn't go away. + nsHttpHandler *handler = nsHttpHandler::get(); + NS_ADDREF(handler); } nsHttpConnection::~nsHttpConnection() @@ -77,6 +81,10 @@ nsHttpConnection::~nsHttpConnection() PR_DestroyLock(mLock); mLock = nsnull; } + + // release our reference to the handler + nsHttpHandler *handler = nsHttpHandler::get(); + NS_RELEASE(handler); } nsresult