udacity / AdvancedAndroid_Shushme

136 stars 367 forks source link

PlaceBuffer must be released after use. #20

Open gshadows opened 6 years ago

gshadows commented 6 years ago

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

osaaroh commented 6 years ago

@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

moharidy commented 6 years ago

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

gshadows commented 6 years ago

@moharidy yeah, you're right.

moharidy commented 6 years ago

thanks a lot and sorry for late thanks:-)

moharidy commented 6 years ago

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