Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
lhoward committed Nov 24, 2024
1 parent 1dc68d4 commit 70decd9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Sources/FlutterSwift/Channel/FlutterEventChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,22 @@ public final class FlutterEventChannel: _FlutterBinaryMessengerConnectionReprese
} catch {
// at this point the task either ended normally or was cancelled;
// remove it from the task dictionary so that we don't leak tasks
debugPrint("*** removing task for \(id) after error \(error)")
self._removeTask(id)
throw error
}
}
_addTask(id, task)
envelope = FlutterEnvelope.success(nil)
case "cancel":
_cancelTask(id)
do {
try await onCancel?(call.arguments)
envelope = FlutterEnvelope.success(nil)
} catch let error as FlutterError {
envelope = FlutterEnvelope.failure(error)
}
_cancelTask(id)
debugPrint("*** cancelled task for \(id)")
default:
envelope = nil
}
Expand Down

0 comments on commit 70decd9

Please sign in to comment.