summaryrefslogtreecommitdiff
path: root/src/termio/Thread.zig
diff options
context:
space:
mode:
authorMitchell Hashimoto <mitchell.hashimoto@gmail.com>2022-11-03 15:07:51 -0700
committerMitchell Hashimoto <mitchell.hashimoto@gmail.com>2022-11-05 19:31:02 -0700
commit9b3d22e55e2fef2697a75f06b59d31c87ae5bf0f (patch)
tree948386faa3eec39ce42d590efff8a8de7d9f84d5 /src/termio/Thread.zig
parent35c1decd58af93efcd693d195ce5010706a6bf5a (diff)
IO thread has more state setup
Diffstat (limited to 'src/termio/Thread.zig')
-rw-r--r--src/termio/Thread.zig5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/termio/Thread.zig b/src/termio/Thread.zig
index ac30fb070..9e81aa482 100644
--- a/src/termio/Thread.zig
+++ b/src/termio/Thread.zig
@@ -113,8 +113,9 @@ pub fn threadMain(self: *Thread) void {
fn threadMain_(self: *Thread) !void {
// Run our thread start/end callbacks. This allows the implementation
// to hook into the event loop as needed.
- try self.impl.threadEnter(self.loop);
- defer self.impl.threadExit();
+ var data = try self.impl.threadEnter(self.loop);
+ defer data.deinit();
+ defer self.impl.threadExit(data);
// Set up our async handler to support rendering
self.wakeup.setData(self);