Solve regressions with KMP

This commit is contained in:
loucass003 committed 2026-05-11 13:13:57 +02:00
1 parent d8041833f1
commit f2b540d0bd
18 files changed
+537 -122

No files matched your search

@@ -29,10 +29,11 @@ import dev.slimevr.trackingchecklist.TrackingChecklist
import dev.slimevr.udp.UdpServer
import dev.slimevr.vmc.VMCManager
import dev.slimevr.vrcosc.VRCOSCManager
import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
fun main(args: Array<String>) = runBlocking {
fun main(args: Array<String>) = runBlocking<Unit> {
ContextDebug.enabled = System.getProperty("slimevr.debug.context") == "true" ||
System.getenv("SLIMEVR_DEBUG_CONTEXT") == "true"
@@ -78,12 +79,16 @@ fun main(args: Array<String>) = runBlocking {
vrcOscManager = vrcOscManager,
)
appContext.startObserving()
try {
appContext.startObserving()
launch { createDesktopHIDManager(appContext, this) }
launch { createSolarXRWebsocketServer(appContext) }
launch { createIpcServers(appContext) }
launch { setupDesktopNetworkProfileChecker(this, networkProfileManager) }
launch { createDesktopHIDManager(appContext, this) }
launch { createSolarXRWebsocketServer(appContext) }
launch { createIpcServers(appContext) }
launch { setupDesktopNetworkProfileChecker(this, networkProfileManager) }
Unit
awaitCancellation()
} finally {
appContext.dispose()
}
}
@@ -56,7 +56,10 @@ class DesktopConfigStorage(
override fun displayPath(path: String): String = resolve(path).absolutePath
private fun resolve(path: String): File = File(root, path)
private fun resolve(path: String): File {
val requested = File(path)
return if (requested.isAbsolute) requested else File(root, path)
}
}
private class RandomAccessTextFileHandle(
@@ -79,6 +82,7 @@ private class RandomAccessTextFileHandle(
}
override suspend fun close() = withContext(Dispatchers.IO) {
file.fd.sync()
file.close()
}
}