Closed Bug 784728 Opened 12 years ago Closed 12 years ago

BatteryObserver is RefCounted, but pointer is managed manually

Categories

(Core :: Hardware Abstraction Layer (HAL), defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla18
blocking-basecamp +

People

(Reporter: marshall, Assigned: marshall)

Details

Attachments

(1 file, 1 obsolete file)

I'm currently seeing this on the ARM emulator in debug builds, when exiting the process to apply a new update.

It looks like GonkHal.cpp tries to manually delete a BatteryObserver pointer, when BatteryObserver extends RefCounted. Relevant lines of code:

http://dxr.mozilla.org/mozilla-central/hal/gonk/GonkHal.cpp.html#280
http://dxr.mozilla.org/mozilla-central/mfbt/RefPtr.h.html#50
Attached patch make sBatteryObserver a RefPtr (obsolete) — Splinter Review
Attachment #654268 - Flags: review?(slee)
You might want to use StaticRefPtr, see bug 772987. And ask jlebar to review the patch.
Egads.
blocking-basecamp: --- → +
Updated patch to use StaticRefPtr
Attachment #654268 - Attachment is obsolete: true
Attachment #654268 - Flags: review?(slee)
Attachment #655487 - Flags: review?(justin.lebar+bug)
Comment on attachment 655487 [details] [diff] [review]
make sBatteryObserver a StaticRefPtr - v1

r=me.  Please push to try and let me know if and when you'd like me to push this patch to m-i for you.
Attachment #655487 - Flags: review?(justin.lebar+bug) → review+
https://hg.mozilla.org/mozilla-central/rev/c05251c5a7e3
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla18
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: