You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@MaikKlein and I had a chat about release, and we sort of converged on the following:
Release should only ever be implemented for types where we know enough to safely release. That means we should only call it on the types which we can also instantiate, and thus know whether they have UserData.
Drop on Physics should be converted to unsafe .release()
Releases should if possible be (mut self) so we can enforce the invariants of release. Otherwise, it should be (&mut self) but safeguard against double deletes by removing the pointer.
All new and from_ptr and similar functions should be pub(crate) and not pub
@MaikKlein feel free to add more as you remember and feel
The text was updated successfully, but these errors were encountered:
@MaikKlein and I had a chat about release, and we sort of converged on the following:
Release should only ever be implemented for types where we know enough to safely release. That means we should only call it on the types which we can also instantiate, and thus know whether they have UserData.
Drop on Physics should be converted to
unsafe .release()
Releases should if possible be
(mut self)
so we can enforce the invariants of release. Otherwise, it should be(&mut self)
but safeguard against double deletes by removing the pointer.All
new
andfrom_ptr
and similar functions should bepub(crate)
and notpub
@MaikKlein feel free to add more as you remember and feel
The text was updated successfully, but these errors were encountered: