diff options
author | portix <portix@gmx.net> | 2014-02-24 01:51:30 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2014-02-24 01:51:30 +0100 |
commit | 0b72cf909b03a1f3a0924e55962a5f8a8d9279d7 (patch) | |
tree | 7e8814b310ed93c69c7ba58d39edb937ee94aa2e | |
parent | 4d384d1caea1989aa816990cb6e68b607f18c407 (diff) | |
download | dwb-0b72cf909b03a1f3a0924e55962a5f8a8d9279d7.zip |
Mark keymap as readonly just before execution
-rw-r--r-- | src/scripts.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/scripts.c b/src/scripts.c index 51212ba8..07efa2a3 100644 --- a/src/scripts.c +++ b/src/scripts.c @@ -1965,7 +1965,6 @@ scripts_eval_key(KeyMap *m, Arg *arg) int nummod = dwb.state.nummod; // set this keymap to readonly so that unbind in the bind callback cannot // free the keymap - m->map->arg.ro = true; if (! (m->map->prop & CP_OVERRIDE)) { CLEAR_COMMAND_TEXT(); @@ -1985,9 +1984,10 @@ scripts_eval_key(KeyMap *m, Arg *arg) CHAR, "arg", arg->p); JSValueRef argv[] = { js_json_to_value(s_global_context, json) }; + m->map->arg.ro = true; call_as_function_debug(s_global_context, arg->js, arg->js, 1, argv); + m->map->arg.ro = false; } - m->map->arg.ro = false; // if id is set to 0 the keymap isn't valid anymore but hasn't been freed yet. if (m->map->arg.i == 0) { unbind_free_keymap(s_global_context, g_list_find(dwb.keymap, m)); |