Closed Bug 1123110 Opened 9 years ago Closed 9 years ago

Clarify the ownership of several cycle collector members; r=smaug

Categories

(Core :: XPCOM, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla38

People

(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)

References

Details

Attachments

(1 file)

      No description provided.
Assignee: nobody → ehsan
Comment on attachment 8550945 [details] [diff] [review]
Clarify the ownership of several cycle collector members

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

Thanks.

::: xpcom/base/nsCycleCollector.cpp
@@ +1256,5 @@
>    CCGraph mGraph;
>    nsAutoPtr<CCGraphBuilder> mBuilder;
>    nsCOMPtr<nsICycleCollectorListener> mListener;
>  
> +  nsCOMPtr<nsIThread> mThread;

This could be made DebugOnly<void*> or void*, as we only compare it with pointers.

@@ +1270,5 @@
>  
>    uint32_t mUnmergedNeeded;
>    uint32_t mMergedInARow;
>  
> +  JSPurpleBuffer* MOZ_OWNING_REF mJSPurpleBuffer;

This could probably be an nsRefPtr<JSPurpleBuffer>.  You'd just have to change the ctor of JSPurpleBuffer and JSPurpleBuffer::mReferenceToThis to an nsRefPtr<>.  Then you could ditch the NS_ADDREF/RELEASE_THIS in JSPurpleBuffer.  If you don't want to do that, I guess I can file a followup bug.
Attachment #8550945 - Flags: review?(bugs) → review+
There was some reason for the unusual addref/release_this...
But if we can use nsRefPtr there, good.
Consider it done!
https://hg.mozilla.org/mozilla-central/rev/7e6b191f83f7
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla38
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: