From a1895201f34bb78d7df6962b76c142ab7ad99509 Mon Sep 17 00:00:00 2001 From: Kyle Date: Mon, 4 Mar 2024 01:53:55 +0800 Subject: [PATCH] Fix non-darwin build crash issue --- Sources/OpenSwiftUI/Core/Graph/GraphHost.swift | 2 +- Sources/OpenSwiftUI/Core/Graph/GraphMutation.swift | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/OpenSwiftUI/Core/Graph/GraphHost.swift b/Sources/OpenSwiftUI/Core/Graph/GraphHost.swift index a156b7ca..c7575b33 100644 --- a/Sources/OpenSwiftUI/Core/Graph/GraphHost.swift +++ b/Sources/OpenSwiftUI/Core/Graph/GraphHost.swift @@ -39,7 +39,7 @@ class GraphHost { // data.globalSubgraph.apply isInstantiated = false } - if let graph = data.graph { + if let _ = data.graph { data.globalSubgraph.invalidate() // graph.context = nil // graph.invalidate() diff --git a/Sources/OpenSwiftUI/Core/Graph/GraphMutation.swift b/Sources/OpenSwiftUI/Core/Graph/GraphMutation.swift index a23b4566..7b9f6a80 100644 --- a/Sources/OpenSwiftUI/Core/Graph/GraphMutation.swift +++ b/Sources/OpenSwiftUI/Core/Graph/GraphMutation.swift @@ -19,6 +19,8 @@ struct EmptyGraphMutation: GraphMutation { } } +// FIXME: #39 +#if canImport(Darwin) struct InvalidatingGraphMutation: GraphMutation { let attribute: OGWeakAttribute @@ -33,6 +35,7 @@ struct InvalidatingGraphMutation: GraphMutation { return mutation.attribute == attribute } } +#endif struct CustomGraphMutation: GraphMutation { let body: () -> Void