6 ms·
Passing ownership to another thread is not the same as forgetting/leaking. The point of !Forget is ensuring that once the owner goes out of scope the destructo
by Dagonfly 1mo ago
Passing ownership to another thread is not the same as forgetting/leaking.
The point of !Forget is ensuring that once the owner goes out of scope the destructor must be guaranteed to run. An infinite loop is not a problem, cause the new thread will never leave its scope. Ref-cycles are a problem, cause you can create a ref-cycle. Then the program flow leaves the scope which will run the drop on all RC's but not the drop on the inner type.