forked from mirrors/gecko-dev
Bug 1791531 - Do not assume that the battery listener has been registered correctly on macOS r=haik
Differential Revision: https://phabricator.services.mozilla.com/D157719
This commit is contained in:
parent
325aad0ef3
commit
8b0f8edb2c
1 changed files with 5 additions and 7 deletions
|
|
@ -195,13 +195,11 @@ void MacPowerInformationService::BeginListening() {
|
|||
}
|
||||
|
||||
void MacPowerInformationService::StopListening() {
|
||||
MOZ_ASSERT(mRunLoopSource,
|
||||
"IOPS Notification Loop Source not set up. "
|
||||
"(StopListening without BeginListening)");
|
||||
|
||||
::CFRunLoopRemoveSource(::CFRunLoopGetCurrent(), mRunLoopSource,
|
||||
kCFRunLoopDefaultMode);
|
||||
mRunLoopSource = nullptr;
|
||||
if (mRunLoopSource) {
|
||||
::CFRunLoopRemoveSource(::CFRunLoopGetCurrent(), mRunLoopSource,
|
||||
kCFRunLoopDefaultMode);
|
||||
mRunLoopSource = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
void MacPowerInformationService::HandleChange(void* aContext) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue