From b9dc17aef47633a9bc5bc05b6f62c456769c50e2 Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Sun, 27 Mar 2022 23:43:16 -0400 Subject: [PATCH] Actively disconnect when the GSView goes away. --- ListenerGS/GSView.swift | 2 ++ ListenerGS/Info.plist | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ListenerGS/GSView.swift b/ListenerGS/GSView.swift index 2090cdb..8cbe263 100644 --- a/ListenerGS/GSView.swift +++ b/ListenerGS/GSView.swift @@ -90,6 +90,8 @@ struct GSView: View { } .alert(item: $connection.errorMessage) { errorMessage in Alert(title:Text(errorMessage.title), message: Text(errorMessage.message)) + }.onDisappear { + connection.disconnect() } Text(connection.textHeard) diff --git a/ListenerGS/Info.plist b/ListenerGS/Info.plist index d3fb390..176e946 100644 --- a/ListenerGS/Info.plist +++ b/ListenerGS/Info.plist @@ -19,7 +19,7 @@ CFBundleShortVersionString 1.0 CFBundleVersion - 780 + 785 LSApplicationCategoryType public.app-category.utilities LSRequiresIPhoneOS