We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8c11219 commit 905cc0bCopy full SHA for 905cc0b
1 file changed
dev/PowerNotifications/PowerNotifications.h
@@ -253,7 +253,8 @@ namespace winrt::Microsoft::Windows::System::Power
253
auto& eventObj{ fn.event() };
254
std::scoped_lock<std::mutex> lock(m_mutex);
255
eventObj.remove(token);
256
- if (RegisteredForEvents(eventObj))
+ // If that was the last registration, remove the OS registration
257
+ if (!RegisteredForEvents(eventObj))
258
{
259
fn.unregisterListener();
260
}
0 commit comments