AdvancedAndroid_Shushme icon indicating copy to clipboard operation
AdvancedAndroid_Shushme copied to clipboard

PlaceBuffer must be released after use.

Open gshadows opened this issue 7 years ago • 5 comments

Google documentation says "NOTE: The calling application must release() this object after it is done with it to prevent a memory leak".

Without this I get this errors in log:

E/DataBuffer: Internal data leak within a DataBuffer object detected! Be sure to explicitly call release() on all DataBuffer extending objects when you are done with them. (internal object: com.google.android.gms.common.data.DataHolder@5ed0442)

To fix this I added if (mPlaces != null) mPlaces.release(); call at the beginning of PlaceListAdapter.swapPlaces().

gshadows avatar May 28 '18 17:05 gshadows

@gshadows I saw that in the documentation too. I've not added it yet (currently on the fourth exercise) and I don't have any error for now

osaaroh avatar Aug 10 '18 18:08 osaaroh

you mean in inside the method swapPlaces() which is inside the PlaceListAdapter.?

moharidy avatar Oct 09 '18 19:10 moharidy

@moharidy yeah, you're right.

gshadows avatar Oct 10 '18 04:10 gshadows

thanks a lot and sorry for late thanks:-)

moharidy avatar Oct 12 '18 20:10 moharidy

i just applied this solution but the recyclerView shows nothing on the Mainactivtiy screen. the location i in DB but it is not shown on the screen

moharidy avatar Oct 12 '18 20:10 moharidy