libgdx / gdx-pay

A libGDX cross-platform API for InApp purchasing.
Apache License 2.0
225 stars 83 forks source link

config doesn't set to null on in dispose at AndroidGooglePlayPurchaseManager. #194

Closed gagbaghdas closed 5 years ago

gagbaghdas commented 5 years ago

Hi Guys.

I found the following. I see that the config is set to null in the dispose method in both PurchaseManageriOSApple and PurchaseManagerAndroidAmazon, but not in AndroidGooglePlayPurchaseManager.

Here is the dispose method of the AndroidGooglePlayPurchaseManager.

 @Override
    public void dispose() {
        googleInAppBillingService.dispose();
        clearCaches();
        observer = null;
    }

Am I wrong that the purchaseManagerConfig should be set to null in this method?

Thanks.

gagbaghdas commented 5 years ago

Also, I'm experiencing the following issue for AndroidGooglePlayPurchaseManager.

If I call the dispose method of the PurchaseManager and install it again, the handlePurchase method doesn't call after the purchase. However, the purchase was made by Google and it is restoring after the restart.

The same flow (dispose and install) is working well for PurchaseManageriOSApple. Not tested for PurchaseManagerAndroidAmazon yet.

Any ideas what is going wrong?

Thanks.

MrStahlfelge commented 5 years ago

Your first message: this is not an issue in my opinion, it would be better to null the config but still having a reference to the config should be no memory leak at all.

To your second issue, please try the Googlebilling implementation. We are in the discussion of deprecating the Googleplay implementation because the emphasized way by Google is to use their billing lib nowadays. I am sure you'll have no problem with the Googlebilling implementation as I am also disposing and reinstalling it in my app.

gagbaghdas commented 5 years ago

Hi @MrStahlfelge . Thanks.

Yes, I agree, there should be no memory leak. Just to be sure.

Hmm... Bad news for me, because I like gdx-pay 👍 Ok. I'll wait before deprecation :D , and then will change to the Googlebilling implementation. ))

MrStahlfelge commented 5 years ago

I did not suggest not to use gdx-pay, but gdx-pay-android-googlebilling instead of gdx-pay-android-googleplay

gagbaghdas commented 5 years ago

Ah, got it. Thanks.

MrStahlfelge commented 5 years ago

We deprecated googleplay implementation in favor of the googlebilling implementation, so issues for the old implementation will be closed now. Please check if googlebilling works as intended for you.