Context dropped before Core causes segfault
If I trigger a move of an instantiated registry object, and then bind listeners to it, they are never invoked. If I trigger a move of a core
object then try e.g. .sync(0)
- it will Segfault.
struct Example {
core: Core
}
impl Example {
fn factory() -> Result<Example> {
let mainloop = MainLoop::new()?;
let context = Context::new(&mainloop)?;
let core = context.connect(None)?;
let e = Example {
core,
};
Ok(e)
}
pub fn crash() -> Result<()> {
let e= Example::factory()?;
e.core.sync(0)?; // CRASH
Ok(())
}
}
Edited by Benjamin Sammons