Clear repositories correctly

This commit is contained in:
Sylwester Zielinski
2023-04-26 11:53:02 +02:00
parent 4579ade633
commit fde67ff547
6 changed files with 6 additions and 0 deletions

View File

@@ -111,6 +111,7 @@ class CGMRepository @Inject constructor(
} }
fun release() { fun release() {
_data.value = CGMServiceData()
_stopEvent.tryEmit(DisconnectAndStopEvent()) _stopEvent.tryEmit(DisconnectAndStopEvent())
} }
} }

View File

@@ -106,6 +106,7 @@ class CSCRepository @Inject constructor(
} }
fun release() { fun release() {
_data.value = CSCServiceData()
_stopEvent.tryEmit(DisconnectAndStopEvent()) _stopEvent.tryEmit(DisconnectAndStopEvent())
} }
} }

View File

@@ -102,6 +102,7 @@ class HRSRepository @Inject constructor(
} }
fun release() { fun release() {
_data.value = HRSServiceData()
_stopEvent.tryEmit(DisconnectAndStopEvent()) _stopEvent.tryEmit(DisconnectAndStopEvent())
} }
} }

View File

@@ -100,6 +100,7 @@ class HTSRepository @Inject constructor(
fun release() { fun release() {
logger = null logger = null
_data.value = HTSServiceData()
_stopEvent.tryEmit(DisconnectAndStopEvent()) _stopEvent.tryEmit(DisconnectAndStopEvent())
} }
} }

View File

@@ -95,6 +95,7 @@ class RSCSRepository @Inject constructor(
fun release() { fun release() {
logger = null logger = null
_data.value = RSCSServiceData()
_stopEvent.tryEmit(DisconnectAndStopEvent()) _stopEvent.tryEmit(DisconnectAndStopEvent())
} }
} }

View File

@@ -125,6 +125,7 @@ class UARTRepository @Inject internal constructor(
} }
fun release() { fun release() {
_data.value = UARTServiceData()
_stopEvent.tryEmit(DisconnectAndStopEvent()) _stopEvent.tryEmit(DisconnectAndStopEvent())
} }
} }