Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix leaking issue when add lifecycle observer#296

Open
hoangthan wants to merge 1 commit intorive-app:master from
hoangthan:bugfix/memory-leak-lifecycle-observer
Open

Fix leaking issue when add lifecycle observer #296
hoangthan wants to merge 1 commit intorive-app:master from
hoangthan:bugfix/memory-leak-lifecycle-observer

Conversation

@hoangthan
Copy link

@hoangthan hoangthan commented Jun 24, 2023
edited
Loading

Since the context is using ActivityLifeCycle. So trying to add lifeCycleObserver without remove when the view is being detached will causing leak memory issue.

The lifeCycleObserver is already remove itself once the lifeCycle is reached onDestroyed. But with activity, it will be never called until the activity is going on destroyed.

Copy link
Contributor

Since the context is using ActivityLifeCycle. So trying to add lifeCycleObserver without remove when the view is being detached will causing leak memory issue.

The lifeCycleObserver is already remove itself once the lifeCycle is reached onDestroyed. But with activity, it will be never called until the activity is going on destroyed.

The behavior for this flow has now been revised and adjusted by re-evaluating the LifecycleOwner on attach. Do you still the leak on the latest version?

Copy link

Since the context is using ActivityLifeCycle. So trying to add lifeCycleObserver without remove when the view is being detached will causing leak memory issue.
The lifeCycleObserver is already remove itself once the lifeCycle is reached onDestroyed. But with activity, it will be never called until the activity is going on destroyed.

The behavior for this flow has now been revised and adjusted by re-evaluating the LifecycleOwner on attach. Do you still the leak on the latest version?

Is 5.1.5 the latest version ?

Copy link

Since the context is using ActivityLifeCycle. So trying to add lifeCycleObserver without remove when the view is being detached will causing leak memory issue.
The lifeCycleObserver is already remove itself once the lifeCycle is reached onDestroyed. But with activity, it will be never called until the activity is going on destroyed.

The behavior for this flow has now been revised and adjusted by re-evaluating the LifecycleOwner on attach. Do you still the leak on the latest version?

The life-cycler you're using is activity lifecycle. The observer will be never removed in case activity not going on destroyed.
You should remove the observer while the RiveTextureView is going to detached.

Copy link
Contributor

Since the context is using ActivityLifeCycle. So trying to add lifeCycleObserver without remove when the view is being detached will causing leak memory issue.
The lifeCycleObserver is already remove itself once the lifeCycle is reached onDestroyed. But with activity, it will be never called until the activity is going on destroyed.

The behavior for this flow has now been revised and adjusted by re-evaluating the LifecycleOwner on attach. Do you still the leak on the latest version?

The life-cycler you're using is activity lifecycle. The observer will be never removed in case activity not going on destroyed. You should remove the observer while the RiveTextureView is going to detached.

The latest version is 6.0.0, is that what you're using?
Changes were introduced here but we're not referencing the Activity directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /