Deep clone method and other ownership features
I'd like to have some of the following methods for
deep_clone, that creates a copy of self and all object it references. There should be no shared references within the returned object.
make_unique, that internally clones all objects that are referenced more than once. In the best case, the pixbuf is already unique and the method is a no-op. In the worst case (there are multiple references to that Pixbuf), a full
make_uniquewould change anything or not.
All three methods require inside information about the internals. 2 and 3 moreover require information about reference counters on the sub-objects. I absolutely don't know how feasible or how much effort they are to implement.
My motivation is to build some thread-safe abstraction around this. I'm using the Rust bindings at the other end and cannot do anything threaded without
unsafe at the moment. I've picked
Pixbuf as a first simply because it is the one I need the most at the moment for pre-rendering things on a background thread.