Closed Bug 463882 Opened 13 years ago Closed 13 years ago
Download Manager::Init is not safe for multiple calls
Bug 457110 made it possible to call nsDownloadManager::Init multiple times to switch the database engine. Some parts of this method are not safe for multiple calls, for example switching the database can cause multiple copies of each observer being registered, which at best can waste memory and processing power, and at worst might manifest itself through other bugs. The patch is simple enough. We need to take this because any user who switches to/from the private browsing mode is going to trigger this.
Attachment #347135 - Flags: review?(sdwilsh)
Attachment #347135 - Flags: review?(sdwilsh) → review-
Comment on attachment 347135 [details] [diff] [review] Patch (v1) I would be more inclined to make a new method that does the database switching work, and keep Init as it is.
OK, I did that in this patch. I made sure that all the unit tests pass successfully with this patch applied.
Comment on attachment 348051 [details] [diff] [review] Patch (v2) hg generated a very unuseful patch there... r=sdwilsh
Attachment #348051 - Flags: review?(sdwilsh) → review+
Comment on attachment 348051 [details] [diff] [review] Patch (v2) a191=beltzner
Attachment #348051 - Flags: approval1.9.1? → approval1.9.1+
Please make sure you attach a patch that has the username in it next time. I almost pushed this as me. http://hg.mozilla.org/mozilla-central/rev/73d9cfe0174c
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1b3
You need to log in before you can comment on or make changes to this bug.