mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-31 07:37:24 +00:00
![]() When converting a Weak<VT, T> into Weak<VT, Dyn>, we were ignoring that while T inside VRcInner may be at a certain offset to satisfy alignment, the empty Dyn field may not and thus be at a different offset. On wasm32 for example the compiler generated component struct has a 16-byte alignment, while the Dyn has none. So converting the Weak<VT, Dyn> to a VRc<VT, Dyn> and then calling borrow() would use the wrong instance pointer. To fix this, this patch introduces an extra offset field that's preserved during the casting and that's used for borrow() as well as drop(). |
||
---|---|---|
.. | ||
const-field-offset | ||
vtable |