From bfedc3d9d74be04d5cc287ab9766ee4d57162248 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Thu, 15 Aug 2019 17:11:07 +0200 Subject: [PATCH] MedtronicFragment synchronized --- .../androidaps/plugins/pump/medtronic/MedtronicFragment.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt index 2efafde16c..a77de2e4a4 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/pump/medtronic/MedtronicFragment.kt @@ -111,6 +111,7 @@ class MedtronicFragment : Fragment() { updateGUI() } + @Synchronized override fun onResume() { super.onResume() MainApp.bus().register(this) @@ -142,6 +143,7 @@ class MedtronicFragment : Fragment() { }, { FabricPrivacy.logException(it) }) } + @Synchronized override fun onPause() { super.onPause() disposable.clear() @@ -249,7 +251,9 @@ class MedtronicFragment : Fragment() { } // GUI functions + @Synchronized fun updateGUI() { + if (medtronic_rl_status == null) return val plugin = MedtronicPumpPlugin.getPlugin() val pumpStatus = MedtronicUtil.getPumpStatus()