-
Federico Mena Quintero authored
We had this: pub extern "C" fn rsvg_tree_free(tree: *mut RsvgTree) { if !tree.is_null() { let _ = unsafe { Box::from_raw(tree) }; ^ gets a Box<RsvgTree>, which is a box of a zero-sized enum I.e. it frees zero bytes :) With need this rebinding: let tree = unsafe { &mut *(tree as *mut Tree) }; i.e. cast tree as *mut Tree, so we'll end up with a Box<Tree> which *can* be dropped as appropriate. #325
2d3ddca1