How bad of an idea is it to pass variable-capturing lambdas as StableRefs to C callbacks? i.e. pass my callback function as the data pointer, and make the static C function unwrap and call it. Example in thread.
Haha, fairly certain this was why StableRef was introduced. I do this all the time.
Dominaezzz
04/15/2021, 5:01 PM
As long as you're not calling the callback in another thread, there's nothing to worry about.
c
Clocks
04/15/2021, 9:35 PM
Are you doing another GTK library for kotlin?
s
serebit
04/16/2021, 2:28 AM
Nope, I'm drawing inspiration from yours to improve my direct C bindings! I didn't really feel like pulling in an entire lib, and yours is still experimental, but it's solved some problems that I was struggling with initially.