Skip to content

Commit

Permalink
prefsutil: fix subscription leak in recursion_guard()
Browse files Browse the repository at this point in the history
  • Loading branch information
amezin committed Oct 20, 2022
1 parent e3462b0 commit 3ff04fb
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions prefsutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,17 @@ function recursion_guard() {
if (!rxjs.isObservable(arg))
return call(arg);

return new rxjs.Observable(subscriber => {
arg.subscribe({
next(value) {
call(() => subscriber.next(value));
},
error(error) {
subscriber.error(error);
},
complete() {
subscriber.complete();
},
});
});
return new rxjs.Observable(subscriber => arg.subscribe({
next(value) {
call(() => subscriber.next(value));
},
error(error) {
subscriber.error(error);
},
complete() {
subscriber.complete();
},
}));
};
}

Expand Down

0 comments on commit 3ff04fb

Please sign in to comment.