Skip to content

Commit

Permalink
bug fix: AsyncReduksActivity safe casting on destroy for stopping actors
Browse files Browse the repository at this point in the history
  • Loading branch information
beyondeye authored and daely committed Jan 1, 2018
1 parent 609299a commit 8f0e0e2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.beyondeye.reduks.experimental.activity
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.beyondeye.reduks.*
import com.beyondeye.reduks.bus.BusStore
import com.beyondeye.reduks.experimental.AsyncStore
import com.beyondeye.reduksAndroid.activity.ActionRestoreState
import com.beyondeye.reduksAndroid.activity.ReduksActivity
Expand Down Expand Up @@ -33,7 +34,10 @@ abstract class AsyncReduksActivity<S>: ReduksActivity<S>, AppCompatActivity() {
super.onStart()
}
override fun onDestroy() {
(reduks.store as AsyncStore).stopActors()
var store=reduks.store
if(store is BusStore)
store = store.wrappedStore
(store as? AsyncStore)?.stopActors()
super.onDestroy()
}
override fun onSaveInstanceState(outState: Bundle?) {
Expand Down

0 comments on commit 8f0e0e2

Please sign in to comment.