From f965aff863b3cd16e49a8aad12f54664ac2d86a5 Mon Sep 17 00:00:00 2001 From: Nicholas Rishel Date: Wed, 24 Aug 2022 22:32:02 +0000 Subject: [PATCH] Bug 1787001 - Fix leaking COM object. r=nalexander `ComPtr` constructor increments the refcount when initializing with a raw COM pointer. Differential Revision: https://phabricator.services.mozilla.com/D155525 --- widget/windows/ToastNotificationHandler.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/widget/windows/ToastNotificationHandler.cpp b/widget/windows/ToastNotificationHandler.cpp index 537f5cb2e936..a5dc11ecc9dc 100644 --- a/widget/windows/ToastNotificationHandler.cpp +++ b/widget/windows/ToastNotificationHandler.cpp @@ -664,8 +664,6 @@ static bool NotificationStillPresent( HRESULT ToastNotificationHandler::OnDismiss(IToastNotification* notification, IToastDismissedEventArgs* aArgs) { - // AddRef as ComPtr doesn't own the object and shouldn't release. - notification->AddRef(); ComPtr comptrNotification(notification); // Don't dismiss notifications when they are still in the action center. We // can receive multiple dismiss events.