mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-07 02:16:34 +00:00
clean up some resources better on error
This commit is contained in:
@@ -65,7 +65,11 @@ pub fn init(
|
||||
|
||||
// Create our event loop.
|
||||
var loop = try libuv.Loop.init(alloc);
|
||||
errdefer loop.deinit(alloc);
|
||||
errdefer {
|
||||
// Run the loop once to close any of our handles
|
||||
_ = loop.run(.nowait) catch 0;
|
||||
loop.deinit(alloc);
|
||||
}
|
||||
loop.setData(allocPtr);
|
||||
|
||||
// This async handle is used to "wake up" the renderer and force a render.
|
||||
|
Reference in New Issue
Block a user