In https://github.com/gtk-rs/gir/pull/415 we started deriving Copy for all FFI structs and unions. This can easily lead to double frees and related problems because it can be non-obvious from the code that a value is actually copied instead of being moved.
In https://github.com/gtk-rs/gir/pull/415 we started deriving
Copy
for all FFI structs and unions. This can easily lead to double frees and related problems because it can be non-obvious from the code that a value is actually copied instead of being moved.https://gitlab.freedesktop.org/gstreamer/gstreamer-rs/-/issues/310 is an example of that.
We should probably stop deriving
Copy
for such structs/unions with pointers.Clone
is still fine as that has to happen explicitly.@EPashkin @GuillaumeGomez @bilelmoussaoui Opinions?