revery-ui / revery

:zap: Native, high-performance, cross-platform desktop apps - built with Reason!
https://www.outrunlabs.com/revery/
MIT License
8.06k stars 196 forks source link

fix(windows): HitTest - Fix missed CAMLreturn in hit test function #1037

Closed bryphe closed 3 years ago

bryphe commented 3 years ago

Issue: Mouse gestures could potentially cause a crash - ie, https://github.com/onivim/oni2/issues/2919

Defect: In our SDL2 hit test callback, there was an CAMLparam and CAMLlocal without a matching CAMLreturn - breaking the OCaml GC rules. This issue had been around for awhile, but it seems that the extra allocation via wrapping in a caml-managed value helped expose it (https://github.com/revery-ui/revery/commit/5fe4207630eb392d4882fe0f2853bf5f7a907b01)

Fix: Add CAMLreturnT to properly wrap the function for the GC