Closed
Bug 799243
Opened 14 years ago
Closed 14 years ago
[b2g-bluetooth] Fix Bluetooth*Manager observer crashes due to non-RefCounted pointer
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
People
(Reporter: qdot, Assigned: qdot)
Details
Attachments
(2 files)
|
4.78 KB,
patch
|
echou
:
review+
|
Details | Diff | Splinter Review |
|
1.96 KB,
patch
|
echou
:
review+
|
Details | Diff | Splinter Review |
Having once again violated the "don't pass a damn nsAutoPtr to the observer manager" rule, shutting down bluetooth profile manager observers crashes due to having an AutoPtr that doesn't clean up correctly when removed from the observer manager (since observer manager holds strong refs). Introduced in bug 798035.
| Assignee | ||
Comment 1•14 years ago
|
||
Attachment #669287 -
Flags: review?(echou)
| Assignee | ||
Comment 2•14 years ago
|
||
Attachment #669289 -
Flags: review?(echou)
| Assignee | ||
Updated•14 years ago
|
Summary: [b2g-bluetooth] Fix Bluetooth*Manager observer crashes due to wrong pointer type holding → [b2g-bluetooth] Fix Bluetooth*Manager observer crashes due to non-RefCounted pointer
Comment 3•14 years ago
|
||
Comment on attachment 669287 [details] [diff] [review]
Patch 1 (v1) - Fix Bluetooth*Manager observer pointers to be nsRefPtr
Review of attachment 669287 [details] [diff] [review]:
-----------------------------------------------------------------
::: dom/bluetooth/BluetoothHfpManager.cpp
@@ +62,5 @@
> +
> + bool Shutdown()
> + {
> + nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
> + if (obs &&
Nit: Because obs may be null here, how about using a MOZ_ASSERT just like what has been done in Init(), or modify the if-statement to "if (!obs || NSFAILED() || NSFAILED())"?
::: dom/bluetooth/BluetoothScoManager.cpp
@@ +51,4 @@
> {
> nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
> if (obs &&
> (NS_FAILED(obs->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID)))) {
Nit: Because obs may be null here, how about using a MOZ_ASSERT just like what has been done in Init(), or modify the if-statement to "if (!obs || NSFAILED())"?
Attachment #669287 -
Flags: review?(echou) → review+
Updated•14 years ago
|
Attachment #669289 -
Flags: review?(echou) → review+
| Assignee | ||
Comment 4•14 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/d01545bde664
https://hg.mozilla.org/integration/mozilla-inbound/rev/66f9632e3539
Target Milestone: --- → mozilla18
Comment 5•14 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d01545bde664
https://hg.mozilla.org/mozilla-central/rev/66f9632e3539
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Target Milestone: mozilla18 → mozilla19
Updated•14 years ago
|
blocking-basecamp: ? → +
Comment 6•14 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•