Skip to content

Commit

Permalink
fix(osx): Fix acquire/release runtime OSX callbacks
Browse files Browse the repository at this point in the history
__Issue:__ In Onivim 2, after removing the acquire/release runtime calls in #1072, I saw the native menu was crashing

This actually reproduces in the example app in a couple ways:
- Clicking on a native menu item
- Clicking on a native button

__Defect:__ The native menu callbacks assume the runtime will be released, but that's not the case anymore after #1072 

__Fix:__ Remove the release/acquire runtime pairs in the callback helper
  • Loading branch information
bryphe committed May 26, 2021
1 parent b27b0b9 commit ed67416
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Native/utilities.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 12,14 @@
*/
void revery_caml_call_n(camlValue f, int argCount, camlValue *args) {
caml_c_thread_register();
caml_acquire_runtime_system();
// With the change to remove the acquire/release runtime calls in:
// https://github.com/revery-ui/revery/pull/1072
// it seems that this acquire/release pair is no longer required
// (...and will crash).

// caml_acquire_runtime_system();
caml_callbackN(f, argCount, args);
caml_release_runtime_system();
//caml_release_runtime_system();
}

void revery_caml_call(camlValue f) {
Expand Down

0 comments on commit ed67416

Please sign in to comment.