mirror of https://github.com/ceph/go-ceph
rados: add a function for use as a finalizer for any opStep
This utility function avoids having to have a custom finalizer for every op step. It calls the free() function to release any allocated C memory the step may have. Signed-off-by: John Mulligan <jmulligan@redhat.com>
This commit is contained in:
parent
f1934a5513
commit
2a31d6a411
|
@ -112,6 +112,12 @@ func (o *operation) update(kind opKind, ret C.int) error {
|
|||
}
|
||||
}
|
||||
|
||||
func opStepFinalizer(s opStep) {
|
||||
if s != nil {
|
||||
s.free()
|
||||
}
|
||||
}
|
||||
|
||||
// withoutUpdate can be embedded in a struct to help indicate
|
||||
// the type implements the opStep interface but has a no-op
|
||||
// update function.
|
||||
|
|
Loading…
Reference in New Issue