Skip to content

LoginRadiusAuthManager is leaking GoogleNativeActivity #8

@herrbert74

Description

@herrbert74

LoginRadiusAuthManager is leaking GoogleNativeActivity, because a lambda in GoogleNativeActivity is passed into a static field in LoginRadiusAuthManager.

LeakCanary trace:

 │ GC Root: Thread object
 │
 ├─ WV.mk instance
 │    Leaking: NO (PathClassLoader↓ is not leaking)
 │    Thread name: 'CleanupReference'
 │    ↓ Thread.contextClassLoader
 ├─ dalvik.system.PathClassLoader instance
 │    Leaking: NO (LoginRadiusAuthManager↓ is not leaking and A ClassLoader is never leaking)
 │    ↓ ClassLoader.runtimeInternalObjects
 ├─ java.lang.Object[] array
 │    Leaking: NO (LoginRadiusAuthManager↓ is not leaking)
 │    ↓ Object[4122]
 ├─ com.loginradius.androidsdk.helper.LoginRadiusAuthManager class
 │    Leaking: NO (a class is never leaking)
 │    ↓ static LoginRadiusAuthManager.asyncHandler
 │                                    ~~~~~~~~~~~~
 ├─ com.loginradius.androidsdk.activity.GoogleNativeActivity$1 instance
 │    Leaking: UNKNOWN
 │    Retaining 130.0 kB in 2246 objects
 │    Anonymous class implementing com.loginradius.androidsdk.handler.AsyncHandler
 │    this$0 instance of com.loginradius.androidsdk.activity.GoogleNativeActivity with mDestroyed = true
 │    ↓ GoogleNativeActivity$1.this$0
 │                             ~~~~~~
 ╰→ com.loginradius.androidsdk.activity.GoogleNativeActivity instance
 ​     Leaking: YES (ObjectWatcher was watching this because com.loginradius.androidsdk.activity.GoogleNativeActivity
 ​     received Activity#onDestroy() callback and Activity#mDestroyed is true)
 ​     Retaining 130.0 kB in 2245 objects
 ​     key = ab3eeedb-c14e-4363-aeb3-73543d89f968
 ​     watchDurationMillis = 7675
 ​     retainedDurationMillis = 2674
 ​     context instance of com.loginradius.androidsdk.activity.GoogleNativeActivity with mDestroyed = true
 ​     mApplication instance of com.mirror.news.MirrorApp
 ​     mBase instance of androidx.appcompat.view.ContextThemeWrapper

As a side note, the 5.0.0 Release Notes do not mention the change in the Maven group name (android to androidsdk), so it's not really easy to install. The installation section was also not updated with the new group name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions