]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
librados: release pimpl pointer in destructor
authorKefu Chai <kchai@redhat.com>
Fri, 6 Sep 2019 17:29:49 +0000 (01:29 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 22 Nov 2019 16:43:45 +0000 (00:43 +0800)
commit91c7ecb490606d51d89792cdf534fa7ce032b949
tree6d79f9b8cdced203197512a3ac53ca9b5414fd4b
parent4c3127d28279510a5117bd5ab11374ad3f5559d4
librados: release pimpl pointer in destructor

before this change, the librados applications are responsible to call
`AioCompletion::release()` explicitly to release its internal pimpl
pointer. this is error prone and not intuitive.

after this change, the destructor of `AioCompletion` and
`PoolAsyncCompletion` will do this automatically. while
`AioCompletion::release()` and `PoolAsyncCompletion::release()` still
delete the instance as they did before. so this change is backward
compatible, as existing librados clients can still use `ptr->release()`
to free the completion instance, while new clients can just `delete
ptr`.

librados_test_stub is updated accordingly to match the new model

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/include/rados/librados.hpp
src/librados/librados_c.cc
src/librados/librados_cxx.cc
src/test/librados_test_stub/LibradosTestStub.cc