From 839df0ee5a1cdf34f09280f6343e091b52a55393 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 10 Jan 2018 17:30:30 +0900 Subject: [PATCH] Remove observer on cleanup --- atom/browser/mac/in_app_purchase_observer.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/atom/browser/mac/in_app_purchase_observer.mm b/atom/browser/mac/in_app_purchase_observer.mm index 379f405c2b..47e35e22e7 100644 --- a/atom/browser/mac/in_app_purchase_observer.mm +++ b/atom/browser/mac/in_app_purchase_observer.mm @@ -50,6 +50,14 @@ using InAppTransactionCallback = return self; } +/** + * Cleanup. + */ +- (void)dealloc { + [[SKPaymentQueue defaultQueue] removeTransactionObserver:self]; + [super dealloc]; +} + /** * Run the callback in the browser thread. *