mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-06 18:06:33 +00:00
renderer/termio attach thread local state for crash capture
This commit is contained in:
@@ -5,6 +5,7 @@ pub const Thread = @This();
|
||||
const std = @import("std");
|
||||
const builtin = @import("builtin");
|
||||
const xev = @import("xev");
|
||||
const crash = @import("../crash/main.zig");
|
||||
const renderer = @import("../renderer.zig");
|
||||
const apprt = @import("../apprt.zig");
|
||||
const configpkg = @import("../config.zig");
|
||||
@@ -191,6 +192,12 @@ pub fn threadMain(self: *Thread) void {
|
||||
fn threadMain_(self: *Thread) !void {
|
||||
defer log.debug("renderer thread exited", .{});
|
||||
|
||||
// Setup our crash metadata
|
||||
crash.sentry.thread_state = .{
|
||||
.surface = self.renderer.surface_mailbox.surface,
|
||||
};
|
||||
defer crash.sentry.thread_state = null;
|
||||
|
||||
// Run our loop start/end callbacks if the renderer cares.
|
||||
const has_loop = @hasDecl(renderer.Renderer, "loopEnter");
|
||||
if (has_loop) try self.renderer.loopEnter(self);
|
||||
|
Reference in New Issue
Block a user