libgdx / gdx-pay

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

Memory Leak #264

Open Animan2010 opened 3 months ago

Animan2010 commented 3 months ago

Issue details, reproduction steps/code

On the Android, when the application is restarted multiple times using back button (destroys activity but not application), despite calls to destroy, activity, reportfragment and some google class leaks remain in the memory dump. If you remove the final attribute from the activity inside class PurchaseManagerGoogleBilling and assign activity to null in the destroy(), then the leaks disappear.

Version of gdx-pay and/or relevant dependencies

1.3.7

Stacktrace

image image

Please select the affected platforms and payment service implementation

MrStahlfelge commented 3 months ago

Good catch, feel free to open a pr

Animan2010 commented 3 months ago

Good catch, feel free to open a pr

I'm not sure that this is a good solution to the problem, rather temporary workaround in my project, it turns out that the PurchaseManagerGoogleBilling instance itself remains registered in memory, it might be better to delete it on destroy.

keesvandieren commented 3 months ago

Do you also have the problem in libgdx app as created by gdx setup with just gdx pay added?

If yes, can you share the project?

Op do 27 jun 2024 om 19:09 schreef Animan2010 @.***>

Good catch, feel free to open a pr

I'm not sure that this is a good solution to the problem, rather temporary workaround in my project, it turns out that the PurchaseManagerGoogleBilling instance itself remains registered in memory, it might be better to delete it on destroy.

— Reply to this email directly, view it on GitHub https://github.com/libgdx/gdx-pay/issues/264#issuecomment-2195237460, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAGS5XUIFWNWIVCZOEJ6VALZJRBLLAVCNFSM6AAAAABJ6OAPUGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOJVGIZTONBWGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Animan2010 commented 3 months ago

If yes, can you share the project?

Of course, I created an almost empty project using the current gdx-setup and gdx-pay, the result is the same, leaks if restarting the game on the Android emulator (api 28) multiple using the back key.

https://github.com/Animan2010/GdxTest

image