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
i ask this here, because github discussions seem to not be enabled for this project
i am still quite new to rust and have no experience in c/c++ (or other low-level / systems languages), and with this project i have to use a lot of unsafe and i also read Unsafety, but i could not understand how i could make it (more) safe, especially the following part got me thinking on how to do it properly:
Rust documentation for Qptr:
It's still possible to cause use-after-free by calling a method through QPtr.
Even in a single threaded program, the accessed object can be deleted by a nested call
while one of its methods is still running. In multithreaded context, the object can be deleted
in another thread between the null check and the method call, also resulting in undefined
behavior.
so my question is: how can i make it safe if it may not be safe after having already checked (like with is_null)?
or how can i at least detect that it is wrong / malfunctioned and catch it to recover from it (like a Result in rust)?
The text was updated successfully, but these errors were encountered:
i ask this here, because github discussions seem to not be enabled for this project
i am still quite new to rust and have no experience in c/c++ (or other low-level / systems languages), and with this project i have to use a lot of
unsafe
and i also read Unsafety, but i could not understand how i could make it (more) safe, especially the following part got me thinking on how to do it properly:Rust documentation for
Qptr
:so my question is: how can i make it safe if it may not be safe after having already checked (like with
is_null
)?or how can i at least detect that it is wrong / malfunctioned and catch it to recover from it (like a
Result
in rust)?The text was updated successfully, but these errors were encountered: