]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/librbd/image/CloseRequest.cc
import 15.2.5
[ceph.git] / ceph / src / librbd / image / CloseRequest.cc
index feae4160e521015440965cbbc536bb60d1f9811f..ec8b7fa7e04823658297506b10f2c84961811b1e 100644 (file)
@@ -4,6 +4,7 @@
 #include "librbd/image/CloseRequest.h"
 #include "common/dout.h"
 #include "common/errno.h"
+#include "librbd/ConfigWatcher.h"
 #include "librbd/ExclusiveLock.h"
 #include "librbd/ImageCtx.h"
 #include "librbd/ImageState.h"
@@ -34,6 +35,13 @@ CloseRequest<I>::CloseRequest(I *image_ctx, Context *on_finish)
 
 template <typename I>
 void CloseRequest<I>::send() {
+  if (m_image_ctx->config_watcher != nullptr) {
+    m_image_ctx->config_watcher->shut_down();
+
+    delete m_image_ctx->config_watcher;
+    m_image_ctx->config_watcher = nullptr;
+  }
+
   send_block_image_watcher();
 }