core: hold lock during keyCallback when mouseRefreshLinks is called

From #9812

I'm not sure if this is the root cause of the crash in #9812 but the
LLM-discovered issue that we are not holding a lock here appears to be a
real issue. I manually traced the code paths and thought about this and
looked where we call `mouseRefreshLinks` in other places and this
appears to be a real bug.
pull/9813/head
Mitchell Hashimoto 2025-12-04 19:44:39 -08:00
parent 3f241502c2
commit 6b2097e872
No known key found for this signature in database
GPG Key ID: 523D5DC389D273BC
1 changed files with 2 additions and 0 deletions

View File

@ -2592,6 +2592,8 @@ pub fn keyCallback(
{
// Refresh our link state
const pos = self.rt_surface.getCursorPos() catch break :mouse_mods;
self.renderer_state.mutex.lock();
defer self.renderer_state.mutex.unlock();
self.mouseRefreshLinks(
pos,
self.posToViewport(pos.x, pos.y),