widgets(terminal): set global_vts to null on last exit
This commit is contained in:
parent
044b099227
commit
2f2e38eea5
2 changed files with 4 additions and 2 deletions
|
@ -69,7 +69,6 @@ pub fn spawn(self: *Command, allocator: std.mem.Allocator) !void {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handleSigChild(_: c_int) callconv(.C) void {
|
fn handleSigChild(_: c_int) callconv(.C) void {
|
||||||
std.log.err("sigchild", .{});
|
|
||||||
const result = std.posix.waitpid(-1, 0);
|
const result = std.posix.waitpid(-1, 0);
|
||||||
|
|
||||||
Terminal.global_vt_mutex.lock();
|
Terminal.global_vt_mutex.lock();
|
||||||
|
|
|
@ -107,7 +107,10 @@ pub fn deinit(self: *Terminal) void {
|
||||||
var vts = global_vts orelse break :pid;
|
var vts = global_vts orelse break :pid;
|
||||||
if (self.cmd.pid) |pid|
|
if (self.cmd.pid) |pid|
|
||||||
_ = vts.remove(pid);
|
_ = vts.remove(pid);
|
||||||
if (vts.count() == 0) vts.deinit();
|
if (vts.count() == 0) {
|
||||||
|
vts.deinit();
|
||||||
|
global_vts = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
self.cmd.kill();
|
self.cmd.kill();
|
||||||
if (self.thread) |thread| {
|
if (self.thread) |thread| {
|
||||||
|
|
Loading…
Reference in a new issue