Last Comment Bug 737462 - nsDeviceMotion w/ bug 735330 leaks mochitest-3
: nsDeviceMotion w/ bug 735330 leaks mochitest-3
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Geolocation (show other bugs)
: unspecified
: x86 Mac OS X
: -- normal (vote)
: mozilla14
Assigned To: Doug Turner (:dougt)
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-20 09:11 PDT by Doug Turner (:dougt)
Modified: 2012-03-22 06:25 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch v.1 (2.23 KB, patch)
2012-03-20 09:45 PDT, Doug Turner (:dougt)
no flags Details | Diff | Splinter Review
patch v.1 (2.19 KB, patch)
2012-03-20 13:51 PDT, Doug Turner (:dougt)
mwu.code: review+
Details | Diff | Splinter Review

Description Doug Turner (:dougt) 2012-03-20 09:11:43 PDT
two problems:

1) Shutdown() isn't always called on nsDeviceMotion.  This means that we will not unregister any hal listeners.  We need to call Shutdown as we get destroyed.

2) in hal, there is a list of sensors pointed to by gSensorObservers.  We need to free this as the last sensor is unregistered.
Comment 1 Doug Turner (:dougt) 2012-03-20 09:45:28 PDT
Created attachment 607593 [details] [diff] [review]
patch v.1
Comment 3 Doug Turner (:dougt) 2012-03-20 13:52:19 PDT
ignore that:

-static SensorObserverList *gSensorObservers = NULL;
+static SensorObserverList* gSensorObservers;
Comment 4 Michael Wu [:mwu] 2012-03-20 13:57:37 PDT
(In reply to Doug Turner (:dougt) from comment #3)
> ignore that:
> 
> -static SensorObserverList *gSensorObservers = NULL;
> +static SensorObserverList* gSensorObservers;

I like it though. the removal of =NULL, that is. I have no opinion on which side to keep the * on.
Comment 5 Matt Brubeck (:mbrubeck) 2012-03-20 17:03:45 PDT
Sorry, I backed this out because XUL Fennec was broken by one of the bugs this landed with.  This can probably re-land if it doesn't depend on bug 734854.
https://hg.mozilla.org/integration/mozilla-inbound/rev/4c0b0a3c272f
Comment 6 Marco Bonardo [::mak] (Away 6-20 Aug) 2012-03-22 06:25:29 PDT
https://hg.mozilla.org/mozilla-central/rev/3d6c7cf537de

Note You need to log in before you can comment on or make changes to this bug.