Bug 199113 Mozilla crashes when calling "Manage Stored Cookies" before loading any page

patch by dwitte@stanford.edu r=mvl@exedo.nl sr=darin
This commit is contained in:
timeless%mozdev.org 2003-03-25 23:35:51 +00:00
Родитель 913ad38177
Коммит e4411fc87c
1 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -38,6 +38,8 @@
#include "nsCookieManager.h"
#include "nsCookies.h"
#include "nsICookieService.h"
#include "nsIServiceManager.h"
#include "nsIGenericFactory.h"
#include "nsIScriptGlobalObject.h"
@ -127,6 +129,12 @@ nsCookieManager::~nsCookieManager()
nsresult nsCookieManager::Init()
{
// XXX we need this until we merge the cookiemanager into the cookieservice.
// otherwise, sCookieList is un-initialized (required by COOKIE_Read).
nsresult rv;
nsCOMPtr<nsICookieService> cookieService = do_GetService(NS_COOKIESERVICE_CONTRACTID, &rv);
if (NS_FAILED(rv)) return rv;
COOKIE_Read();
return NS_OK;
}