libgdx/gdx-pay

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

gagbaghdas opened this issue · 6 comments

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.

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.

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.

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. ))

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

Ah, got it. Thanks.

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.