зеркало из https://github.com/mozilla/gecko-dev.git
Bug 737462 - nsDeviceMotion leaks hal observers. r=mwu
This commit is contained in:
Родитель
1ee5aed0ed
Коммит
23746e5ebc
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче