Bug 1221730 - Postpone singleton release in GamepadPlatformService::MaybeShutdown. r=baku

This commit is contained in:
Chih-Yi Leu
2016-06-28 00:27:00 +02:00
parent 8012308286
commit f307964a4d
9 changed files with 101 additions and 51 deletions

View File

@@ -934,9 +934,11 @@ nsAppShell::LegacyGeckoEvent::Run()
case AndroidGeckoEvent::GAMEPAD_ADDREMOVE: {
#ifdef MOZ_GAMEPAD
GamepadPlatformService* service;
RefPtr<GamepadPlatformService> service;
service = GamepadPlatformService::GetParentService();
MOZ_ASSERT(service);
if (!service) {
break;
}
if (curEvent->Action() == AndroidGeckoEvent::ACTION_GAMEPAD_ADDED) {
int svc_id = service->AddGamepad("android",
dom::GamepadMappingType::Standard,
@@ -954,9 +956,11 @@ nsAppShell::LegacyGeckoEvent::Run()
case AndroidGeckoEvent::GAMEPAD_DATA: {
#ifdef MOZ_GAMEPAD
int id = curEvent->ID();
GamepadPlatformService* service;
RefPtr<GamepadPlatformService> service;
service = GamepadPlatformService::GetParentService();
MOZ_ASSERT(service);
if (!service) {
break;
}
if (curEvent->Action() == AndroidGeckoEvent::ACTION_GAMEPAD_BUTTON) {
service->NewButtonEvent(id, curEvent->GamepadButton(),
curEvent->GamepadButtonPressed(),