commit 26/01/2026
This commit is contained in:
11
src/Main.kt
11
src/Main.kt
@@ -105,10 +105,17 @@ fun main() {
|
||||
if (!sdx.CheckDongle()){
|
||||
Logger.error { "Dongle check failed. Application will exit." }
|
||||
exitProcess(1)
|
||||
} else {
|
||||
sdx.startChecking {
|
||||
Logger.error { "Dongle removed. Application will exit." }
|
||||
exitProcess(1)
|
||||
sdx.stopChecking()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (Platform.isWindows()) {
|
||||
// supaya OSHI bisa mendapatkan CPU usage di Windows seperti di Task Manager
|
||||
GlobalConfig.set(GlobalConfig.OSHI_OS_WINDOWS_CPU_UTILITY, true)
|
||||
@@ -239,6 +246,8 @@ fun main() {
|
||||
|
||||
db.Add_Log("AAS"," Application started")
|
||||
|
||||
|
||||
|
||||
// shutdown hook
|
||||
Runtime.getRuntime().addShutdownHook(Thread ({
|
||||
|
||||
@@ -253,6 +262,8 @@ fun main() {
|
||||
StreamerOutputs.values.forEach { it.close() }
|
||||
audioPlayer.Close()
|
||||
db.close()
|
||||
sdx.stopChecking()
|
||||
|
||||
Logger.info { "All services stopped, exiting application." }
|
||||
ProviderRegistry.getLoggingProvider().shutdown()
|
||||
},"ShutdownHook") )
|
||||
|
||||
Reference in New Issue
Block a user