Skip to content

Commit

Permalink
[in_app_purchase] fixed a memory leak error (flutter#5358)
Browse files Browse the repository at this point in the history
  • Loading branch information
yimao009 committed May 17, 2022
1 parent 8ea876c commit a692f84
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.0+8

* Fixes a memory leak on iOS.

## 0.3.0+7

* Minor fixes for new analysis options.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ @interface InAppPurchasePlugin ()

// Callback channel to dart used for when a function from the payment queue delegate is triggered.
@property(strong, nonatomic, readonly) FlutterMethodChannel *paymentQueueDelegateCallbackChannel;

@property(strong, nonatomic, readonly) NSObject<FlutterTextureRegistry> *registry;
@property(strong, nonatomic, readonly) NSObject<FlutterBinaryMessenger> *messenger;
@property(strong, nonatomic, readonly) NSObject<FlutterPluginRegistrar> *registrar;

@property(strong, nonatomic, readonly) FIAPReceiptManager *receiptManager;
Expand Down Expand Up @@ -57,8 +54,6 @@ - (instancetype)initWithReceiptManager:(FIAPReceiptManager *)receiptManager {
- (instancetype)initWithRegistrar:(NSObject<FlutterPluginRegistrar> *)registrar {
self = [self initWithReceiptManager:[FIAPReceiptManager new]];
_registrar = registrar;
_registry = [registrar textures];
_messenger = [registrar messenger];

__weak typeof(self) weakSelf = self;
_paymentQueueHandler = [[FIAPaymentQueueHandler alloc] initWithQueue:[SKPaymentQueue defaultQueue]
Expand Down Expand Up @@ -347,7 +342,7 @@ - (void)registerPaymentQueueDelegate:(FlutterResult)result {
if (@available(iOS 13.0, *)) {
_paymentQueueDelegateCallbackChannel = [FlutterMethodChannel
methodChannelWithName:@"plugins.flutter.io/in_app_purchase_payment_queue_delegate"
binaryMessenger:_messenger];
binaryMessenger:[_registrar messenger]];

_paymentQueueDelegate = [[FIAPPaymentQueueDelegate alloc]
initWithMethodChannel:_paymentQueueDelegateCallbackChannel];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: in_app_purchase_storekit
description: An implementation for the iOS platform of the Flutter `in_app_purchase` plugin. This uses the StoreKit Framework.
repository: https://github.com/flutter/plugins/tree/main/packages/in_app_purchase/in_app_purchase_storekit
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+in_app_purchase%22
version: 0.3.0+7
version: 0.3.0+8

environment:
sdk: ">=2.14.0 <3.0.0"
Expand Down

0 comments on commit a692f84

Please sign in to comment.