Closed Bug 1512557 Opened 11 months ago Closed 11 months ago

nsIStringBundle references not freed in nsCharsetConverterManager

Categories

(MailNews Core :: Internationalization, enhancement)

enhancement
Not set

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 65.0

People

(Reporter: darktrojan, Assigned: darktrojan)

Details

Attachments

(1 file)

No description provided.
I could've done this by just adding the Shutdown() call, but since I need to learn more about these things, I did more.
Attachment #9029899 - Flags: review?(jorgk)
Comment on attachment 9029899 [details] [diff] [review]
1512557-free-pointers-1.diff

As you said, adding Shutdown() would have done the trick. Personally I suggest to give StaticRefPtr<> a go instead, since the COM-ness is not a factor here.

Is this perhaps the key to bug 1377692? Ben was chasing some leak. Maybe he can see whether the patch fixes something, or we'll notice when it lands.
Flags: needinfo?(benc)
Comment on attachment 9029899 [details] [diff] [review]
1512557-free-pointers-1.diff

As per our IRC conversation, using StaticRefPtr gives compile errors, but this works:
static RefPtr<nsIStringBundle> sDataBundle;
static RefPtr<nsIStringBundle> sTitleBundle;

In the end it doesn't matter since all we care about it the ref-counting and the release, in this case decreasing the ref-count by nulling the reference.
Attachment #9029899 - Flags: review?(jorgk) → review+
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/21219ad63ec8
Convert nsIStringBundle pointers to nsCOMPtrs and release them when shutting down. r=jorgk DONTBUILD
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
I took the liberty to inline the Shutdown() function since it didn't have much use otherwise.
Target Milestone: --- → Thunderbird 65.0
Didn't help bug 1377692.
Flags: needinfo?(benc)
You need to log in before you can comment on or make changes to this bug.