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:
Justin Lebar 2012-08-18 09:55:59 -04:00
Родитель 16944609f7
Коммит 431379fa00
3 изменённых файлов: 17 добавлений и 1 удалений

Просмотреть файл

@ -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();
}