Open Bug 924658 Opened 12 years ago Updated 3 years ago

Only provide one explicit function for converting a WeakPtrBase into a T*

Categories

(Core :: MFBT, defect)

defect

Tracking

()

People

(Reporter: ehsan.akhgari, Unassigned)

Details

Attachments

(1 file)

See bug 923554 for the reasoning. Specifically I think we should remove all three operators from that class and stick to calling get() explicitly.
Attached patch WIP!Splinter Review
I took a stab at this. Of course this breaks the build in all sorts of ways, and the code using WeakPtr should be audited carefully to see if the weak pointers are being used in safe ways.
I posted about this to dev.platform.
Don't forget to update the example code using a WeakPtr in a boolean context! :) https://hg.mozilla.org/mozilla-central/file/552bca1bc885/mfbt/WeakPtr.h#l43
OS: Mac OS X → All
Hardware: x86 → All
(In reply to comment #3) > Don't forget to update the example code using a WeakPtr in a boolean context! > :) > > https://hg.mozilla.org/mozilla-central/file/552bca1bc885/mfbt/WeakPtr.h#l43 Haha good catch, we should probably do a SafeBool thingy here <http://www.artima.com/cppsource/safebool.html>
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: