I've set up In-App Billing v3 on an app according to the Google Developers page on that subject. I'm pretty much following the same approach and steps from their TrivialDrive sample application (as can be seen, for example, here).
It all works OK (querying inventory, purchases, item consumption, etc. work) but I've been facing some rather annoying memory leaks.
If I switch the phone's orientation a couple of times, cause Garbage Collection, do a HPROF dump and analyse using MAT, I can see that a bunch of Threads
are still alive and kicking, while they shouldn't.
It's not a lot of memory, but it still accumulates in any Activity
where I use IabHelper
... And yes, I am disposing my IabHelper
instance (hell, even set the listeners as null...) in my Activity's onDestroy()
:
@Override
protected void onDestroy() {
super.onDestroy();
(...)
if (mHelper != null)
mHelper.dispose();
mHelper = null;
mGotInventoryListener = null;
mPurchaseFinishedListener = null;
}
Is anyone having the same issues? Can anyone point me in the right direction to fix this? Thanks in advance for any input.