Don't return the ItemWeak by value

It is not working in C++ because ItemWeak has a destructor
This commit is contained in:
Olivier Goffart 2021-01-26 13:17:24 +01:00
parent 802383cd6b
commit a4abb86782
5 changed files with 25 additions and 18 deletions

View file

@ -38,9 +38,11 @@ pub struct ComponentVTable {
index: usize,
) -> core::pin::Pin<VRef<ItemVTable>>,
/// Return the parent item. The return value is an item weak because it can be null if
/// there is no parent
pub parent_item: extern "C" fn(core::pin::Pin<VRef<ComponentVTable>>, index: usize) -> ItemWeak,
/// Return the parent item.
/// The return value is an item weak because it can be null if there is no parent.
/// And the return value is passed by &mut because ItemWeak has a destructor
pub parent_item:
extern "C" fn(core::pin::Pin<VRef<ComponentVTable>>, index: usize, result: &mut ItemWeak),
/// Returns the layout info for this component
pub layout_info: extern "C" fn(core::pin::Pin<VRef<ComponentVTable>>) -> LayoutInfo,