Skip to content

Commit 70f8df3

Browse files
kaquKaQuMiQ
authored andcommitted
fix mutex memory leak
1 parent 33328d3 commit 70f8df3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Futura/Future/Future.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,14 @@ public final class Future<Value> {
7070
#endif
7171

7272
deinit {
73+
defer { Mutex.destroy(mtx) }
7374
guard case .waiting = state else { return }
7475
let observers = self.observers
7576
executionContext.execute {
7677
for observer in observers {
7778
observer(.canceled)
7879
}
7980
}
80-
Mutex.destroy(mtx)
8181
}
8282
}
8383

0 commit comments

Comments
 (0)