Closed
Bug 533530
Opened 15 years ago
Closed 13 years ago
junk training data not saved if plugin leaks, need a quit observer
Categories
(MailNews Core :: Filters, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 8.0
People
(Reporter: rkent, Assigned: Bienvenu)
Details
(Keywords: dataloss)
Attachments
(1 file, 1 obsolete file)
6.10 KB,
patch
|
rkent
:
review+
|
Details | Diff | Splinter Review |
While doing some testing for my extensions, I noticed that training data was not getting saved on shutdown. Data is supposed to be saved in the destructor for nsBayesianFilter, but that destructor was not getting called (presumably because of some sort of shutdown leak) which I confirmed with printf statements in the destructor. While the shutdown leak seems to be caused by my extensions, still saving of training data is too important to rely on no leaks. We should add a quit observer to make sure that the data gets saved.
Updated•13 years ago
|
Summary: junk training data not saved if plugin leaks → junk training data not saved if plugin leaks, need a quit observer
Assignee | ||
Comment 1•13 years ago
|
||
I don't know if the issue is that the destructor isn't called. Even if it is called, it's too late to do things like NS_GetSpecialDirectory so training data won't get saved. I'm going to fix this, because I'm trying to fix the memory leaks from the xpcshell tests and test_junkingWhenDisabled leaks a lot of stuff.
Assignee: kent → dbienvenu
Assignee | ||
Comment 2•13 years ago
|
||
I need to add an Init method because you can't add observers in the constructor, because there are no references to the service yet, and it gets deleted out from under me when I add an observer. Init also has the nice advantage that you can actually return errors, though I haven't taken advantage of that.
Attachment #546949 -
Flags: review?(kent)
Assignee | ||
Comment 3•13 years ago
|
||
Comment on attachment 546949 [details] [diff] [review] proposed fix clearing review request because I think this patch exposes issues w/ other tests
Attachment #546949 -
Flags: review?(kent)
Assignee | ||
Comment 4•13 years ago
|
||
minimal fix - I tried moving more stuff into Init() but got into a world of hurt that I don't feel like revisiting...
Attachment #546949 -
Attachment is obsolete: true
Attachment #547109 -
Flags: review?(kent)
Reporter | ||
Comment 5•13 years ago
|
||
Comment on attachment 547109 [details] [diff] [review] minimal fix The patch as listed does not work: +NS_GENERIC_FACTORY_CONSTRUCTOR(nsBayesianFilter, Init) should be +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsBayesianFilter, Init) With that change, I tested this with printf's and with and without artificial leaks, and it seems to work. r=me with that error fixed.
Attachment #547109 -
Flags: review?(kent) → review+
Assignee | ||
Comment 6•13 years ago
|
||
thx for catching that! That would explain the weirdness I saw. Though I would have expected even more... http://hg.mozilla.org/comm-central/rev/1bf028c0289b
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 8.0
You need to log in
before you can comment on or make changes to this bug.
Description
•