Mercurial > hg > rlgwebd
comparison rlgwebd @ 213:08665c56c6a0 default tip
Fix race condition related to watching DGL games.
It's possible for a dgamelaunch game to end and cause rlgwebd to stop watching
it before rlgwebd has started watching it.
author | John "Elwin" Edwards |
---|---|
date | Sun, 16 Aug 2020 20:56:18 -0400 |
parents | e6af951def94 |
children |
comparison
equal
deleted
inserted
replaced
212:e6af951def94 | 213:08665c56c6a0 |
---|---|
416 this.startchunk(); | 416 this.startchunk(); |
417 /* If another kind of event appears, something strange happened. */ | 417 /* If another kind of event appears, something strange happened. */ |
418 }; | 418 }; |
419 | 419 |
420 DglSession.prototype.close = function () { | 420 DglSession.prototype.close = function () { |
421 this.recwatcher.close(); | 421 /* The watcher might not be open yet. */ |
422 if ("recwatcher" in this) | |
423 this.recwatcher.close(); | |
422 /* Ensure all data is handled before quitting. */ | 424 /* Ensure all data is handled before quitting. */ |
423 this.startchunk(); | 425 this.startchunk(); |
424 var connlist = this.watchers; | 426 var connlist = this.watchers; |
425 this.watchers = []; | 427 this.watchers = []; |
426 for (var i = 0; i < connlist.length; i++) { | 428 for (var i = 0; i < connlist.length; i++) { |