diff --git a/intl/uconv/nsUTF8ConverterService.h b/intl/uconv/nsUTF8ConverterService.h index 00f6c831ada4..078c061d666c 100644 --- a/intl/uconv/nsUTF8ConverterService.h +++ b/intl/uconv/nsUTF8ConverterService.h @@ -9,14 +9,22 @@ //============================================================== +class nsUTF8ConverterService; + +namespace mozilla { +template<> +struct HasDangerousPublicDestructor +{ + static const bool value = true; +}; +} + class nsUTF8ConverterService: public nsIUTF8ConverterService { -public: NS_DECL_ISUPPORTS NS_DECL_NSIUTF8CONVERTERSERVICE +public: nsUTF8ConverterService() {} - -private: virtual ~nsUTF8ConverterService() {} }; diff --git a/netwerk/cookie/nsCookie.cpp b/netwerk/cookie/nsCookie.cpp index aa654df6a838..c32420891045 100644 --- a/netwerk/cookie/nsCookie.cpp +++ b/netwerk/cookie/nsCookie.cpp @@ -80,9 +80,9 @@ nsCookie::Create(const nsACString &aName, { // Ensure mValue contains a valid UTF-8 sequence. Otherwise XPConnect will // truncate the string after the first invalid octet. - nsRefPtr converter = new nsUTF8ConverterService(); + nsUTF8ConverterService converter; nsAutoCString aUTF8Value; - converter->ConvertStringToUTF8(aValue, "UTF-8", false, true, 1, aUTF8Value); + converter.ConvertStringToUTF8(aValue, "UTF-8", false, true, 1, aUTF8Value); // find the required string buffer size, adding 4 for the terminating nulls const uint32_t stringLength = aName.Length() + aUTF8Value.Length() +