mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 737462 - nsDeviceMotion leaks hal observers. r=mwu
This commit is contained in:
parent
f9ae7a37f3
commit
20a9ae5e15
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user