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.
Created attachment 607593 [details] [diff] [review] patch v.1
Created attachment 607705 [details] [diff] [review] patch v.1 https://tbpl.mozilla.org/?tree=Tryfirstname.lastname@example.org
ignore that: -static SensorObserverList *gSensorObservers = NULL; +static SensorObserverList* gSensorObservers;
(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.
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