avoid crash at device (re)start

This commit is contained in:
Juha Heinanen
2018-11-03 13:15:23 +02:00
parent 9b98378f0c
commit 3416e28f73

View File

@ -426,9 +426,9 @@ class BaresipService: Service() {
} catch (e: Exception) {
Log.d(LOG_TAG, "Receiver nr has not been registered")
}
nm.cancelAll()
if (wl.isHeld) wl.release()
if (fl.isHeld) fl.release()
if (this::nm.isInitialized) nm.cancelAll()
if (this::wl.isInitialized && wl.isHeld) wl.release()
if (this::fl.isInitialized && fl.isHeld) fl.release()
if (IS_SERVICE_RUNNING)
baresipStop(false)
else if (RESTARTING)