nsISaveAsCharset is not service and should be called by CreateInstance

RESOLVED FIXED in M16

Status

()

Core
Internationalization
P3
normal
RESOLVED FIXED
18 years ago
13 years ago

People

(Reporter: Frank Tang, Assigned: Erik van der Poel)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

18 years ago
The nsISaveAsCharset is not a service, it should not be called by GetService, 
but CreateInstance. The copy should NOT be shared by different caller. 

1396 PRUint32
1397 nsFontGTKSubstitute::Convert(const PRUnichar* aSrc, PRUint32 aSrcLen,
1398   PRUnichar* aDest, PRUint32 aDestLen)
1399 {
1400   nsresult res;
1401   if (!gConverter) {
1402     nsServiceManager::GetService(kSaveAsCharsetCID,
1403       NS_GET_IID(nsISaveAsCharset), (nsISupports**) &gConverter);
1404     if (gConverter) {
1405       res = gConverter->Init("ISO-8859-1",
1406                              nsISaveAsCharset::attr_FallbackQuestionMark +
1407                                
nsISaveAsCharset::attr_EntityBeforeCharsetConv,
1408                              nsIEntityConverter::transliterate);
1409       if (NS_FAILED(res)) {
1410         nsServiceManager::ReleaseService(kSaveAsCharsetCID, gConverter);
1411         gConverter = nsnull;
1412       }
1413     }
1414   }
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
Target Milestone: --- → M16

Updated

18 years ago
QA Contact: teruko → ftang
(Assignee)

Comment 1

18 years ago
Fixed. Now calling CreateInstance instead of GetService.
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.