Skip to content

Commit c0831d1

Browse files
committed
updated Migration doc
1 parent 8795d30 commit c0831d1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

V4_MIGRATION_GUIDE.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,10 @@ migrate to the Builder.
302302
### Handling Configuration Changes During Authentication
303303

304304
v4 fixes a memory leak and lost callback issue when the Activity is destroyed during authentication
305-
(e.g. device rotation, locale change, dark mode toggle). The SDK now uses `WeakReference` for
306-
callbacks, so destroyed Activities are properly garbage collected.
305+
(e.g. device rotation, locale change, dark mode toggle). The SDK wraps the callback in a
306+
`LifecycleAwareCallback` that observes the host Activity/Fragment lifecycle. When `onDestroy` fires,
307+
the reference to the callback is immediately nulled out so the destroyed Activity is no longer held
308+
in memory.
307309

308310
If the authentication result arrives while the Activity is being recreated, it is cached internally.
309311
Use `consumePendingLoginResult()` or `consumePendingLogoutResult()` in your `onResume()` to recover it:

0 commit comments

Comments
 (0)