Closed Bug 1050003 Opened 10 years ago Closed 10 years ago

Remove unnecessary if checks before delete-ing in xpcom/

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla34

People

(Reporter: poiru, Assigned: poiru)

Details

Attachments

(1 file)

      No description provided.
Comment on attachment 8468936 [details] [diff] [review]
Remove unnecessary if checks before delete-ing in xpcom/

Review of attachment 8468936 [details] [diff] [review]:
-----------------------------------------------------------------

::: xpcom/components/nsCategoryManager.cpp
@@ +82,5 @@
>    // BaseStringEnumerator do not implement their own Release() method.
>  
>    virtual ~BaseStringEnumerator()
>    {
> +    delete [] mArray;

Maybe this member should just be a mozilla::UniquePtr?
Attachment #8468936 - Flags: review?(nfroyd) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/d5b07a783243

Try push: https://tbpl.mozilla.org/?tree=Try&rev=d5795053e886

(In reply to Nathan Froyd (:froydnj) from comment #2)
> >    virtual ~BaseStringEnumerator()
> >    {
> > +    delete [] mArray;
> 
> Maybe this member should just be a mozilla::UniquePtr?

I'll file a follow-up for this and other similar cases.
https://hg.mozilla.org/mozilla-central/rev/d5b07a783243
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.