All four pre-nif_load-safe setters (mob_set_launch_notification + mob_set_opened_document, Android zig + iOS ObjC) read the mutex global twice: once to decide whether to lock, once to unlock. If a warm event lands exactly while nif_load is creating the mutex, a setter could skip the lock but then unlock a mutex it never locked (UB). Vanishingly narrow window; one-line fix per function — capture the pointer into a local and use it for both decisions. Found during PR #77 review (see review comment there for file/line refs at that head: zig ~2255/2258, ObjC ~2392/2396).
All four pre-nif_load-safe setters (mob_set_launch_notification + mob_set_opened_document, Android zig + iOS ObjC) read the mutex global twice: once to decide whether to lock, once to unlock. If a warm event lands exactly while nif_load is creating the mutex, a setter could skip the lock but then unlock a mutex it never locked (UB). Vanishingly narrow window; one-line fix per function — capture the pointer into a local and use it for both decisions. Found during PR #77 review (see review comment there for file/line refs at that head: zig ~2255/2258, ObjC ~2392/2396).