Ouch! Don't use |dont_AddRef| like that! I don't even know what that does!

VERIFIED FIXED in mozilla0.9.1

Status

()

Core
Editor
P3
normal
VERIFIED FIXED
17 years ago
17 years ago

People

(Reporter: Scott Collins, Assigned: Blake Ross)

Tracking

Trunk
mozilla0.9.1
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
|(dont_AddRef)(expr)| should be re-written as |dont_AddRef(expr)|.  I'll do an
experiment, but it is likely the first form does not do what you expect, and
therefore leaks.
(Reporter)

Comment 1

17 years ago
OK, it really turns out to be a meme originating with buster ... cc'ing him.

Comment 2

17 years ago
I'm sure I just cut-and-pasted some code from somewhere at some point.  I'm not
smart enough to dream that up on my own :)
Nothing was intentional about the use of this idiom.  If it's wrong, kill it
dead. Is it causing leaks?
(Reporter)

Comment 3

17 years ago
Two points: (a) turns out this syntax _is_ legal.  See section 13.3.1.1 of the
C++ standard [[Thanks to Waldemar for finding this reference]].  The expression
representing the function to be called can be nested arbitrarily deep in
parentheses.  And (b) this doesn't leak.  The right thing happens.  We only want
to get rid of this form because it's confusing to readers who won't know that
and will think this is some kind of typecast.

Comment 4

17 years ago
Because this code pattern is harmless, future for now. We'll fix post RTM.
Target Milestone: --- → Future

Comment 5

17 years ago
moz 0.9
Status: NEW → ASSIGNED
Target Milestone: Future → mozilla0.9

Comment 6

17 years ago
moving a bunch of 0.9 bugs to 0.9.1
Target Milestone: mozilla0.9 → mozilla0.9.1
(Assignee)

Comment 7

17 years ago
Created attachment 26149 [details] [diff] [review]
[patch] make things prettier
(Assignee)

Comment 8

17 years ago
scc, sr?
Assignee: jfrancis → blakeross
Status: ASSIGNED → NEW
(Reporter)

Comment 9

17 years ago
nice :-)  sr=scc

Comment 10

17 years ago
r=timeless
you learn something new everyday.
(Assignee)

Comment 11

17 years ago
Fix checked in.
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 12

17 years ago
blake or scc, please verify and mark verified-fixed. thanks!
(Assignee)

Comment 13

17 years ago
[verified]
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.