1
Fork 0

Reset c.sc after calling onclose.

The onclose callback might want to access c.sc.
This commit is contained in:
Juliusz Chroboczek 2023-08-29 01:42:48 +02:00
parent 892a4b8401
commit cc2ed14484
1 changed files with 2 additions and 1 deletions

View File

@ -1216,10 +1216,11 @@ Stream.prototype.close = function(replace) {
let changed = recomputeUserStreams(c.sc, userid);
if(changed && c.sc.onuser)
c.sc.onuser.call(c.sc, userid, "change");
c.sc = null;
if(c.onclose)
c.onclose.call(c, replace);
c.sc = null;
};
/**