Closed
Bug 657210
Opened 12 years ago
Closed 12 years ago
Outparamdel nsEditor::GetPresShell
Categories
(Core :: DOM: Editor, defect)
Core
DOM: Editor
Tracking
()
VERIFIED
FIXED
mozilla6
People
(Reporter: Ms2ger, Assigned: Ms2ger)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
24.16 KB,
patch
|
ehsan.akhgari
:
review+
|
Details | Diff | Splinter Review |
Barely any consumer checks the nsresult return value. I hope you like.
Attachment #532511 -
Flags: review?(ehsan)
Flags: in-testsuite-
Do we really need to addref on this method?
Comment 2•12 years ago
|
||
Comment on attachment 532511 [details] [diff] [review] Patch v1 Review of attachment 532511 [details] [diff] [review]: ----------------------------------------------------------------- ::: editor/libeditor/base/nsEditor.cpp @@ +537,5 @@ > NS_PRECONDITION(mDocWeak, "bad state, null mDocWeak"); > nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocWeak); > + NS_ENSURE_TRUE(doc, NULL); > + nsRefPtr<nsIPresShell> ps = doc->GetShell(); > + return ps.forget(); Can't you just say: return doc->GetShell()
Attachment #532511 -
Flags: review?(ehsan) → review+
Comment 3•12 years ago
|
||
(In reply to comment #2) > ::: editor/libeditor/base/nsEditor.cpp > @@ +537,5 @@ > > NS_PRECONDITION(mDocWeak, "bad state, null mDocWeak"); > > nsCOMPtr<nsIDocument> doc = do_QueryReferent(mDocWeak); > > + NS_ENSURE_TRUE(doc, NULL); > > + nsRefPtr<nsIPresShell> ps = doc->GetShell(); > > + return ps.forget(); > > Can't you just say: > > return doc->GetShell() Well, of course you can't! :D Can you just use nsCOMPtr? r=me with that.
Comment 4•12 years ago
|
||
(In reply to comment #1) > Do we really need to addref on this method? It might be needed in some of the cases. We can investigate the possibility of avoiding that in another bug.
Assignee | ||
Comment 5•12 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/6a76f02f19e1
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla6
Assignee | ||
Comment 6•12 years ago
|
||
(In reply to comment #3) > Can you just use nsCOMPtr? r=me with that. And because I forgot you said this: http://hg.mozilla.org/mozilla-central/rev/5e204a657cac
Setting resolution to Verified Fixed on Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20100101 Firefox/6.0b3
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•