Samples are reference counted: they should always be used with shared_ptr.