Skip to content

Commit

Permalink
* fix memory leak (sockeqwe/mosby#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwert2603 committed May 3, 2018
1 parent 776928d commit d700653
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.2.40'
ext.kotlin_version = '1.2.41'
repositories {
google()
jcenter()
Expand Down
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {

ext.support_version = '27.1.1'
ext.mosby_version = '3.1.0'
ext.rxjava_version = '2.1.12'
ext.rxjava_version = '2.1.13'
ext.rxandroid_version = '2.0.2'
ext.rxbinding_version = '2.1.1'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.qwert2603.andrlib.base.mvi

import android.annotation.TargetApi
import android.app.Activity
import android.app.Application
import android.content.Context
import android.os.Build
import android.support.annotation.CallSuper
Expand Down Expand Up @@ -39,6 +41,8 @@ abstract class BaseFrameLayout<VS : Any, V : BaseView<VS>, P : BasePresenter<V,

override fun onDetachedFromWindow() {
viewDisposable.clear()
(mviDelegate as? Application.ActivityLifecycleCallbacks)
?.let { (context as Activity).application.unregisterActivityLifecycleCallbacks(it) }
super.onDetachedFromWindow()
}

Expand Down

0 comments on commit d700653

Please sign in to comment.