Bug 1173802: Store global NFC service in ref-counted variable, r=allstars.chh

|ClearOnShutdown| deletes pointers by assigning |nullptr|. This
patch converts |gNfcService| to a smart pointer, so that cleaning
its value during shutdown will actually destruct the instance.
This commit is contained in:
Thomas Zimmermann 2015-07-31 10:07:25 +02:00
Родитель d79778ce4e
Коммит eb8fc500c5
1 изменённых файлов: 2 добавлений и 2 удалений

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

@ -34,7 +34,7 @@ using namespace mozilla::ipc;
namespace mozilla {
static NfcService* gNfcService;
static StaticRefPtr<NfcService> gNfcService;
NS_IMPL_ISUPPORTS(NfcService, nsINfcService)
@ -456,7 +456,7 @@ NfcService::FactoryCreate()
ClearOnShutdown(&gNfcService);
}
nsRefPtr<NfcService> service = gNfcService;
nsRefPtr<NfcService> service(gNfcService);
return service.forget();
}