diff options
author | Jason Miller <jasom@fastmail.com> | 2020-05-23 14:22:07 +0200 |
---|---|---|
committer | Jason Miller <jasom@fastmail.com> | 2020-05-23 14:22:07 +0200 |
commit | 13b2af4b613c09983814aff53bfa51ead57fc0cd (patch) | |
tree | ad23d3f17a446aa0feab21169046780cc71a06e3 | |
parent | 2d737173b127e64cafed7b38bf93a07d4aac4018 (diff) | |
download | xbindkeys-13b2af4b613c09983814aff53bfa51ead57fc0cd.tar.gz |
Prevent scheme functions to be garbage collected
-rw-r--r-- | keys.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -105,6 +105,9 @@ add_key (KeyType_t type, EventType_t event_type, KeySym keysym, KeyCode keycode, modifier &= ~(numlock_mask | capslock_mask | scrolllock_mask); +#ifdef GUILE_FLAG + if(function) scm_gc_protect_object(function); +#endif /* set key */ if (type == SYM) { @@ -344,6 +347,9 @@ free_key (Keys_t * key) if (key->command != NULL) free (key->command); +#ifdef GUILE_FLAG + if(key->function) scm_gc_unprotect_object(key->function); +#endif key->function = 0; } |