Fix a memory leak with the chat aspect. (#23)

Essentially, the for loop wasn't being returned out
of and that caused the read listener to never be
let up and released to the gc
This commit is contained in:
Bradley Hilton
2020-06-23 01:52:50 -05:00
committed by GitHub
parent 487bd12444
commit fe96739f60
4 changed files with 33 additions and 26 deletions

View File

@@ -66,9 +66,9 @@ function setupWebsocket() {
// Uncomment to point to somewhere other than goth.land
const protocol = location.protocol == "https:" ? "wss" : "ws"
// var ws = new WebSocket(protocol + "://" + location.host + "/entry")
var ws = new WebSocket(protocol + "://" + location.host + "/entry")
var ws = new WebSocket("wss://goth.land/entry")
// var ws = new WebSocket("wss://goth.land/entry")
ws.onmessage = (e) => {
const model = JSON.parse(e.data)