Skip to content

Commit

Permalink
Try fix for weird context related crash
Browse files Browse the repository at this point in the history
  • Loading branch information
rubengees committed Nov 5, 2017
1 parent 0df3db4 commit 23861f8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/kotlin/me/proxer/app/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class MainApplication : Application() {
var mangaDatabase by Delegates.notNull<LocalMangaDatabase>()
private set

var globalContext by Delegates.notNull<MainApplication>()
var globalContext by Delegates.notNull<Context>()
private set

var refWatcher by Delegates.notNull<RefWatcher>()
Expand All @@ -101,6 +101,9 @@ class MainApplication : Application() {
return
}

refWatcher = LeakCanary.install(this)
globalContext = applicationContext

AppCompatDelegate.setDefaultNightMode(PreferenceHelper.getNightMode(this))
NotificationUtils.createNotificationChannels(this)

Expand All @@ -111,9 +114,6 @@ class MainApplication : Application() {
.addMigrations(LocalMangaDatabase.MIGRATION_ONE_TWO)
.build()

refWatcher = LeakCanary.install(this)
globalContext = this

initBus()
initApi()
initLibs()
Expand Down

0 comments on commit 23861f8

Please sign in to comment.