By simply deleting the fin, the callbacks will be requeued into
the specified finisher and recalled later, which is not the expected
behaviour.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
assert(fin != NULL);
assert(con != NULL);
}
+
+ ~C_OnFinisher() {
+ if (con != nullptr) {
+ delete con;
+ con = nullptr;
+ }
+ }
+
void finish(int r) {
fin->queue(con, r);
+ con = nullptr;
}
};
C_IO_Wrapper(MDSRank *mds_, MDSInternalContextBase *wrapped_) : MDSIOContext(mds_), wrapped(wrapped_) {
assert(wrapped != NULL);
}
+
+ ~C_IO_Wrapper() {
+ if (wrapped != nullptr) {
+ delete wrapped;
+ wrapped = nullptr;
+ }
+ }
+
virtual void finish(int r) {
wrapped->complete(r);
+ wrapped = nullptr;
}
};