mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-02-02 03:06:29 +00:00
add finalizer to cancel stream subscription when all references to an instance of ElectrumX becomes inaccessible
This commit is contained in:
parent
9c648affe8
commit
67beaf21cd
1 changed files with 5 additions and 0 deletions
|
@ -77,6 +77,11 @@ class ElectrumX {
|
||||||
|
|
||||||
final Duration connectionTimeoutForSpecialCaseJsonRPCClients;
|
final Duration connectionTimeoutForSpecialCaseJsonRPCClients;
|
||||||
|
|
||||||
|
// add finalizer to cancel stream subscription when all references to an
|
||||||
|
// instance of ElectrumX becomes inaccessible
|
||||||
|
static final Finalizer<ElectrumX> _finalizer = Finalizer(
|
||||||
|
(p0) => p0._torStatusListener?.cancel(),
|
||||||
|
);
|
||||||
StreamSubscription<TorStatusChangedEvent>? _torStatusListener;
|
StreamSubscription<TorStatusChangedEvent>? _torStatusListener;
|
||||||
|
|
||||||
ElectrumX({
|
ElectrumX({
|
||||||
|
|
Loading…
Reference in a new issue