Closed
Bug 711554
Opened 13 years ago
Closed 13 years ago
finalize statements and close connection
Categories
(Firefox :: Search, defect)
Tracking
()
RESOLVED
FIXED
Firefox 12
People
(Reporter: espindola, Assigned: espindola)
Details
Attachments
(1 file, 3 obsolete files)
|
1.81 KB,
patch
|
mak
:
review+
|
Details | Diff | Splinter Review |
No description provided.
| Assignee | ||
Comment 1•13 years ago
|
||
Comment 2•13 years ago
|
||
Comment on attachment 582336 [details] [diff] [review]
finalize statements and close connection
Review of attachment 582336 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/components/search/nsSearchService.js
@@ +3622,5 @@
> + closeDB: function epsCloseDB() {
> + this.mInsertData.finalize();
> + this.mDeleteData.finalize();
> + this.mGetData.finalize();
> + this.mDB.close();
all of these are getters, you may be initing them there ideally. Before finalizing or closing you should ensure if they are still getters or not with Object.getOwnPropertyDescriptor(this, "property").value !== undefined
it's probably simpler to put the properties names in a temp array and loop it.
Attachment #582336 -
Flags: review?(mak77) → review-
| Assignee | ||
Comment 3•13 years ago
|
||
Attachment #582336 -
Attachment is obsolete: true
Attachment #583207 -
Flags: review?(mak77)
Comment 4•13 years ago
|
||
Comment on attachment 583207 [details] [diff] [review]
finalize statements and close connection
Review of attachment 583207 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/components/search/nsSearchService.js
@@ +3624,5 @@
> + this.mInsertData.finalize();
> + if (this.getOwnPropertyDescriptor(this, "mDeleteData").value !== undefined)
> + this.mDeleteData.finalize();
> + if (this.getOwnPropertyDescriptor(this, "mGetData").value !== undefined)
> + this.mGetData.finalize();
something like this may work
["mInsertData", "mDeleteData", "mGetData"].forEach(function(aStmt) {
if (Object.getOwnPropertyDescriptor(this, aStmt).value !== undefined)
this[aStmt].finalize();
}, this);
@@ +3625,5 @@
> + if (this.getOwnPropertyDescriptor(this, "mDeleteData").value !== undefined)
> + this.mDeleteData.finalize();
> + if (this.getOwnPropertyDescriptor(this, "mGetData").value !== undefined)
> + this.mGetData.finalize();
> + this.mDB.close();
also mDB is a lazy getter, it should be handled similarly as the statements.
Attachment #583207 -
Flags: review?(mak77) → review-
| Assignee | ||
Comment 5•13 years ago
|
||
Attachment #583207 -
Attachment is obsolete: true
Attachment #583544 -
Flags: review?(mak77)
| Assignee | ||
Comment 6•13 years ago
|
||
Attachment #583544 -
Attachment is obsolete: true
Attachment #583544 -
Flags: review?(mak77)
Attachment #583561 -
Flags: review?(mak77)
Comment 7•13 years ago
|
||
Comment on attachment 583561 [details] [diff] [review]
finalize statements and close connection
Review of attachment 583561 [details] [diff] [review]:
-----------------------------------------------------------------
looks good
Attachment #583561 -
Flags: review?(mak77) → review+
| Assignee | ||
Comment 8•13 years ago
|
||
Comment 9•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 12
You need to log in
before you can comment on or make changes to this bug.
Description
•