mirror of https://github.com/fairyglade/ly.git
seems to fix segfault by not giving up control of the tty, shutting down when it's aready deferred could be the issue?
This commit is contained in:
parent
5e05d29e0c
commit
c54ca6761d
|
@ -97,9 +97,9 @@ pub fn draw(self: Doom) void {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn initBuffer(buffer: []u8, width: usize) void {
|
fn initBuffer(buffer: []u8, width: usize) void {
|
||||||
const length = buffer.len - width;
|
const length = buffer.len;
|
||||||
const slice_start = buffer[0..length];
|
const slice_start = buffer[0..length];
|
||||||
const slice_end = buffer[length..];
|
const slice_end = buffer[length - width .. length];
|
||||||
|
|
||||||
@memset(slice_start, 0);
|
@memset(slice_start, 0);
|
||||||
@memset(slice_end, STEPS - 1);
|
@memset(slice_end, STEPS - 1);
|
||||||
|
|
|
@ -317,9 +317,9 @@ pub fn main() !void {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var animation_timer = switch(config.animation) {
|
var animation_timer = switch (config.animation) {
|
||||||
.none => undefined,
|
.none => undefined,
|
||||||
else => try std.time.Timer.start()
|
else => try std.time.Timer.start(),
|
||||||
};
|
};
|
||||||
|
|
||||||
const animate = config.animation != .none;
|
const animate = config.animation != .none;
|
||||||
|
@ -345,7 +345,6 @@ pub fn main() !void {
|
||||||
try info_line.addMessage(lang.err_console_dev, config.error_bg, config.error_fg);
|
try info_line.addMessage(lang.err_console_dev, config.error_bg, config.error_fg);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
while (run) {
|
while (run) {
|
||||||
// If there's no input or there's an animation, a resolution change needs to be checked
|
// If there's no input or there's an animation, a resolution change needs to be checked
|
||||||
if (!update or config.animation != .none) {
|
if (!update or config.animation != .none) {
|
||||||
|
@ -706,7 +705,7 @@ pub fn main() !void {
|
||||||
defer allocator.free(password_text);
|
defer allocator.free(password_text);
|
||||||
|
|
||||||
// Give up control on the TTY
|
// Give up control on the TTY
|
||||||
_ = termbox.tb_shutdown();
|
// _ = termbox.tb_shutdown();
|
||||||
|
|
||||||
session_pid = try std.posix.fork();
|
session_pid = try std.posix.fork();
|
||||||
if (session_pid == 0) {
|
if (session_pid == 0) {
|
||||||
|
|
Loading…
Reference in New Issue