зеркало из https://github.com/mozilla/gecko-dev.git
fixing a leak
This commit is contained in:
Родитель
5ff5374817
Коммит
64bb31dfdd
|
@ -38,6 +38,7 @@
|
||||||
#include "nsNetUtil.h"
|
#include "nsNetUtil.h"
|
||||||
#include "nsIDNSService.h" // for host error code
|
#include "nsIDNSService.h" // for host error code
|
||||||
#include "nsIWalletService.h"
|
#include "nsIWalletService.h"
|
||||||
|
#include "nsIAllocator.h"
|
||||||
|
|
||||||
static NS_DEFINE_CID(kWalletServiceCID, NS_WALLETSERVICE_CID);
|
static NS_DEFINE_CID(kWalletServiceCID, NS_WALLETSERVICE_CID);
|
||||||
static NS_DEFINE_CID(kStreamConverterServiceCID, NS_STREAMCONVERTERSERVICE_CID);
|
static NS_DEFINE_CID(kStreamConverterServiceCID, NS_STREAMCONVERTERSERVICE_CID);
|
||||||
|
@ -96,8 +97,13 @@ nsFtpConnectionThread::Process() {
|
||||||
PRBool continueRead = PR_FALSE, brokenLine = PR_FALSE;
|
PRBool continueRead = PR_FALSE, brokenLine = PR_FALSE;
|
||||||
nsCAutoString carryOverBuf;
|
nsCAutoString carryOverBuf;
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
|
nsXPIDLCString spec;
|
||||||
|
(void)mURL->GetSpec(getter_Copies(spec));
|
||||||
|
|
||||||
PR_LOG(gFTPLog, PR_LOG_DEBUG, ("nsFtpConnectionThread::Process() started for %x (spec =%s)\n",
|
PR_LOG(gFTPLog, PR_LOG_DEBUG, ("nsFtpConnectionThread::Process() started for %x (spec =%s)\n",
|
||||||
mURL.get(), (const char *) mURLSpec));
|
mURL.get(), spec));
|
||||||
|
#endif // DEBUG
|
||||||
|
|
||||||
while (mKeepRunning) {
|
while (mKeepRunning) {
|
||||||
switch(mState) {
|
switch(mState) {
|
||||||
|
@ -758,8 +764,10 @@ nsFtpConnectionThread::Process() {
|
||||||
} // END: switch
|
} // END: switch
|
||||||
} // END: while loop
|
} // END: while loop
|
||||||
|
|
||||||
|
#ifdef DEBUG
|
||||||
PR_LOG(gFTPLog, PR_LOG_DEBUG, ("nsFtpConnectionThread::Process() ended for %x (spec =%s)\n\n\n",
|
PR_LOG(gFTPLog, PR_LOG_DEBUG, ("nsFtpConnectionThread::Process() ended for %x (spec =%s)\n\n\n",
|
||||||
mURL.get(), (const char *) mURLSpec));
|
mURL.get(), spec));
|
||||||
|
#endif // DEBUG
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -1723,15 +1731,11 @@ nsFtpConnectionThread::Init(nsIProtocolHandler* aHandler,
|
||||||
rv = aChannel->GetURI(getter_AddRefs(mURL));
|
rv = aChannel->GetURI(getter_AddRefs(mURL));
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
char *spec = nsnull;
|
|
||||||
rv = mURL->GetSpec(&spec);
|
|
||||||
if (NS_FAILED(rv)) return rv;
|
|
||||||
mURLSpec = nsUnescape(spec);
|
|
||||||
|
|
||||||
char *path = nsnull;
|
char *path = nsnull;
|
||||||
rv = mURL->GetPath(&path);
|
rv = mURL->GetPath(&path);
|
||||||
if (NS_FAILED(rv)) return rv;
|
if (NS_FAILED(rv)) return rv;
|
||||||
mPath = nsUnescape(path);
|
mPath = nsUnescape(path);
|
||||||
|
nsAllocator::Free(path);
|
||||||
|
|
||||||
// pull any username and/or password out of the uri
|
// pull any username and/or password out of the uri
|
||||||
nsXPIDLCString uname;
|
nsXPIDLCString uname;
|
||||||
|
|
|
@ -188,7 +188,6 @@ private:
|
||||||
|
|
||||||
// ****** URI vars
|
// ****** URI vars
|
||||||
nsCOMPtr<nsIURI> mURL; // the uri we're connecting to
|
nsCOMPtr<nsIURI> mURL; // the uri we're connecting to
|
||||||
nsXPIDLCString mURLSpec; // raw spec of the url
|
|
||||||
PRInt32 mPort; // the port to connect to
|
PRInt32 mPort; // the port to connect to
|
||||||
nsAutoString mFilename; // url filename (if any)
|
nsAutoString mFilename; // url filename (if any)
|
||||||
PRTime mLastModified;// last modified time for file
|
PRTime mLastModified;// last modified time for file
|
||||||
|
|
Загрузка…
Ссылка в новой задаче