aboutsummaryrefslogtreecommitdiffstats
path: root/dome_key_map.h
diff options
context:
space:
mode:
authorTeddy Wing2018-09-04 16:15:14 +0200
committerTeddy Wing2018-09-06 04:03:20 +0200
commitce1eca32e2249a72692c6eb01052361d98af29c3 (patch)
treeb24d1c6f68d72664e31d6a8952b3ae83fdc1ed2e /dome_key_map.h
parent84d29715900209b8ab4c600ad40ef99cdad03bd6 (diff)
downloaddome-key-map-ce1eca32e2249a72692c6eb01052361d98af29c3.tar.bz2
c_run_key_action(): Fix segfault on `in_mode`
Finally figured out where the problem was with the `in_mode` on my `CKeyActionResult` getting freed too early. It happens because we're trying to use the reference to the `in_mode` slice from the `KeyActionResult` returned by `run_key_action_for_mode()`. We were putting that reference in the `in_mode` of the `CKeyActionResult` returned by `c_run_key_action()`, but it would get freed in that function. In order to make it last indefinitely, we needed to convert it into a raw boxed pointer to prevent Rust from deallocating it. This does mean we now have a memory leak, but we'll just have to make a call into Rust to free it from the C code.
Diffstat (limited to 'dome_key_map.h')
0 files changed, 0 insertions, 0 deletions