about summary refs log tree commit diff stats
path: root/src/display/client.nim
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-05-11 18:13:38 +0200
committerbptato <nincsnevem662@gmail.com>2023-05-11 18:13:38 +0200
commit34b90a0b40fbb624655a2ff8624e89101d71299b (patch)
tree372a790b769ce968afd2035b96de1679a65116e6 /src/display/client.nim
parent87f9bd656b2a8a8d4ebd029ba6a78f1dc93558eb (diff)
downloadchawan-34b90a0b40fbb624655a2ff8624e89101d71299b.tar.gz
Fix some fetch crashes
Now it should work for very basic use-cases
Diffstat (limited to 'src/display/client.nim')
-rw-r--r--src/display/client.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/display/client.nim b/src/display/client.nim
index cd2c9f5d..d0f618e1 100644
--- a/src/display/client.nim
+++ b/src/display/client.nim
@@ -490,7 +490,10 @@ proc launchClient*(client: Client, pages: seq[string], ctype: Option[string], du
       dump = true
   client.ssock = initServerSocket(false)
   client.selector = newSelector[Container]()
-  client.loader.registerFun = proc(fd: int) = client.selector.registerHandle(fd, {Read}, nil)
+  client.loader.registerFun = proc(fd: int) =
+    client.selector.registerHandle(fd, {Read}, nil)
+  client.loader.unregisterFun = proc(fd: int) =
+    client.selector.unregister(fd)
   client.selector.registerHandle(int(client.dispatcher.forkserver.estream.fd), {Read}, nil)
   client.pager.launchPager(tty)
   client.console = newConsole(client.pager, tty)