Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android AppStateManager :: Internal data leak within a DataBuffer object detected

I am using AppState to store my current Android application data. When I call the load method and set a callback listener i see the following in my logcat output.

Internal data leak within a DataBuffer object detected! Be sure to explicitly call close() on all DataBuffer extending objects when you are done with them. (com.google.android.gms.appstate.AppStateBuffer@45454128)

This is my method call (I am not explicitly opening any buffers)

AppStateManager
    .load(getApiClient(), APP_STATE_STATE_KEY)
    .setResultCallback(new ResultCallback<AppStateManager.StateResult>() {
        @Override
        public void onResult(final StateResult stateResult) {
        }
    });

e.g. The onResult() method is empty, so why do i see this logcat entry? What buffer do i need close?

like image 641
Hector Avatar asked Jun 14 '14 20:06

Hector


1 Answers

It's not a buffer what you need to close, but the connection instead. Even though your onResult method is empty it is the result of a callback, which means a connection was established.

I saw the same logcat output with Google Maps Api when I ommited

GoogleApiClient.disconnect()

at the end of the activity/fragment lifecycle

like image 184
Julián Martínez Avatar answered Nov 15 '22 22:11

Julián Martínez