Skip to content

Commit a0bfdf1

Browse files
fix. crash
1 parent cba42a6 commit a0bfdf1

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

  • core/main/src/main/java/com/rk/terminal

core/main/src/main/java/com/rk/terminal/App.kt

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,6 @@ class App : Application() {
2626
}
2727
return tmp
2828
}
29-
30-
init {
31-
GlobalScope.launch(Dispatchers.IO) {
32-
getTempDir().apply {
33-
if (exists() && listFiles().isNullOrEmpty().not()){ deleteRecursively() }
34-
}
35-
}
36-
}
3729
}
3830

3931
@OptIn(DelicateCoroutinesApi::class)
@@ -42,6 +34,12 @@ class App : Application() {
4234
application = this
4335
Res.application = this
4436

37+
GlobalScope.launch(Dispatchers.IO) {
38+
getTempDir().apply {
39+
if (exists() && listFiles().isNullOrEmpty().not()){ deleteRecursively() }
40+
}
41+
}
42+
4543
//Thread.setDefaultUncaughtExceptionHandler(CrashHandler)
4644
ANRWatchDog().start()
4745

0 commit comments

Comments
 (0)