Here is what happens: After `addWidget(w)` the `w` has been moved so its 
destructor does not run. It's the destructor that detects dangling unowned 
refs. However, `seq[Widget]` does not own the memory either. You produced a 
memory leak.

The problem is that in `addWidget` you don't take over the ownership of `w` but 
to the compiler it looks like you do as `seq.add` takes a `sink` parameter. The 
implicit conversion from `owned ref T` to `ref T` is dangerous for `sink` 
parameters. Tough nut. Thanks for this example!

Reply via email to