зеркало из https://github.com/mozilla/pjs.git
Bug 737462 - nsDeviceMotion leaks hal observers. r=mwu
This commit is contained in:
Родитель
a2214854a8
Коммит
aaef4b09f9
|
@ -140,6 +140,9 @@ nsDeviceMotion::nsDeviceMotion()
|
|||
|
||||
nsDeviceMotion::~nsDeviceMotion()
|
||||
{
|
||||
if (mStarted)
|
||||
Shutdown();
|
||||
|
||||
if (mTimeoutTimer)
|
||||
mTimeoutTimer->Cancel();
|
||||
}
|
||||
|
|
|
@ -415,7 +415,7 @@ DisableSensorNotifications(SensorType aSensor) {
|
|||
}
|
||||
|
||||
typedef mozilla::ObserverList<SensorData> SensorObserverList;
|
||||
static SensorObserverList *gSensorObservers = NULL;
|
||||
static SensorObserverList* gSensorObservers = NULL;
|
||||
|
||||
static SensorObserverList &
|
||||
GetSensorObservers(SensorType sensor_type) {
|
||||
|
@ -447,6 +447,8 @@ UnregisterSensorObserver(SensorType aSensor, ISensorObserver *aObserver) {
|
|||
observers.RemoveObserver(aObserver);
|
||||
if(observers.Length() == 0) {
|
||||
DisableSensorNotifications(aSensor);
|
||||
delete [] gSensorObservers;
|
||||
gSensorObservers = nsnull;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче