I think reply_pipe may contain dangling pointer. You may need implement pipe_terminated method.