зеркало из https://github.com/mozilla/gecko-dev.git
Bug 776132 - When the gonk AppShell is trying to shut down the OrientationObserver, don't call OrientationObserver::GetInstance() -- that might /create/ an orientation observer! r=cjones
--HG-- extra : rebase_source : 72ad44ea6edf1c170cb0af6fb3e207550c7bee15
This commit is contained in:
Родитель
16944609f7
Коммит
431379fa00
|
@ -183,6 +183,18 @@ OrientationObserver::~OrientationObserver()
|
|||
}
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
OrientationObserver::ShutDown()
|
||||
{
|
||||
if (!sOrientationSensorObserver) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (sOrientationSensorObserver->mAutoOrientationEnabled) {
|
||||
sOrientationSensorObserver->DisableAutoOrientation();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
OrientationObserver::Notify(const hal::SensorData& aSensorData)
|
||||
{
|
||||
|
|
|
@ -37,6 +37,10 @@ public:
|
|||
OrientationObserver();
|
||||
~OrientationObserver();
|
||||
|
||||
// Call DisableAutoOrientation on the existing OrientatiOnobserver singleton,
|
||||
// if it exists. If no OrientationObserver exists, do nothing.
|
||||
static void ShutDown();
|
||||
|
||||
// Notification from sensor.
|
||||
void Notify(const SensorData& aSensorData);
|
||||
|
||||
|
|
|
@ -529,7 +529,7 @@ nsAppShell::Init()
|
|||
NS_IMETHODIMP
|
||||
nsAppShell::Exit()
|
||||
{
|
||||
OrientationObserver::GetInstance()->DisableAutoOrientation();
|
||||
OrientationObserver::ShutDown();
|
||||
return nsBaseAppShell::Exit();
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче