diff --git a/include/NVMeBasicContext.hpp b/include/NVMeBasicContext.hpp
index ec7a0b1..b17fc05 100644
--- a/include/NVMeBasicContext.hpp
+++ b/include/NVMeBasicContext.hpp
@@ -5,6 +5,8 @@
 #include <boost/asio/io_service.hpp>
 #include <boost/asio/posix/stream_descriptor.hpp>
 
+#include <thread>
+
 class NVMeBasicContext : public NVMeContext
 {
   public:
@@ -19,6 +21,22 @@
     NVMeBasicContext(boost::asio::io_service& io, int rootBus, int cmdOut,
                      int streamIn, int streamOut, int cmdIn);
     boost::asio::io_service& io;
+
+    // The IO thread must be destructed after the stream descriptors, so
+    // initialise it first. http://eel.is/c++draft/class.base.init#note-6
+    //
+    // Providing a stop-source to the thread execution function isn't
+    // particularly useful as it will spend most of its time blocked in a system
+    // call - ioctl() for the actual device communication, or read() and write()
+    // on the pipes associated with reqStream and respStream. Rather than trying
+    // to force a stop, rely on read()/write() failures from closed pipes to
+    // coerce it to exit and thus allow completion of the join().
+    std::jthread thread;
+
+    // Destruction of the stream descriptors has the effect of issuing cancel(),
+    // destroying the closure of the callback where we might be carrying
+    // weak_ptrs to `this`.
+    // https://www.boost.org/doc/libs/1_79_0/doc/html/boost_asio/reference/posix__basic_descriptor/_basic_descriptor.html
     boost::asio::posix::stream_descriptor reqStream;
     boost::asio::posix::stream_descriptor respStream;
 
diff --git a/src/NVMeBasicContext.cpp b/src/NVMeBasicContext.cpp
index 09b58be..322c133 100644
--- a/src/NVMeBasicContext.cpp
+++ b/src/NVMeBasicContext.cpp
@@ -15,7 +15,6 @@
 #include <cstdio>
 #include <cstring>
 #include <system_error>
-#include <thread>
 
 extern "C"
 {
@@ -214,8 +213,8 @@
     FileHandle streamOut(responsePipe[1]);
     respStream.assign(responsePipe[0]);
 
-    std::thread thread([streamIn{std::move(streamIn)},
-                        streamOut{std::move(streamOut)}]() mutable {
+    thread = std::jthread([streamIn{std::move(streamIn)},
+                           streamOut{std::move(streamOut)}]() mutable {
         ssize_t rc = 0;
 
         if ((rc = processBasicQueryStream(streamIn, streamOut)) < 0)
@@ -226,7 +225,6 @@
 
         std::cerr << "Terminating basic query thread\n";
     });
-    thread.detach();
 }
 
 void NVMeBasicContext::readAndProcessNVMeSensor()
@@ -308,7 +306,7 @@
         response->prepare(len);
         return len;
         },
-        [self{shared_from_this()}, sensor, response](
+        [weakSelf{weak_from_this()}, sensor, response](
             const boost::system::error_code& ec, std::size_t length) mutable {
         if (ec)
         {
@@ -322,17 +320,20 @@
             return;
         }
 
-        /* Deserialise the response */
-        response->consume(1); /* Drop the length byte */
-        std::istream is(response.get());
-        std::vector<char> data(response->size());
-        is.read(data.data(), response->size());
+        if (auto self = weakSelf.lock())
+        {
+            /* Deserialise the response */
+            response->consume(1); /* Drop the length byte */
+            std::istream is(response.get());
+            std::vector<char> data(response->size());
+            is.read(data.data(), response->size());
 
-        /* Update the sensor */
-        self->processResponse(sensor, data.data(), data.size());
+            /* Update the sensor */
+            self->processResponse(sensor, data.data(), data.size());
 
-        /* Enqueue processing of the next sensor */
-        self->readAndProcessNVMeSensor();
+            /* Enqueue processing of the next sensor */
+            self->readAndProcessNVMeSensor();
+        }
     });
 }
 
@@ -341,8 +342,8 @@
     pollCursor = sensors.begin();
 
     scanTimer.expires_from_now(boost::posix_time::seconds(1));
-    scanTimer.async_wait(
-        [self{shared_from_this()}](const boost::system::error_code errorCode) {
+    scanTimer.async_wait([weakSelf{weak_from_this()}](
+                             const boost::system::error_code errorCode) {
         if (errorCode == boost::asio::error::operation_aborted)
         {
             return;
@@ -354,7 +355,10 @@
             return;
         }
 
-        self->readAndProcessNVMeSensor();
+        if (auto self = weakSelf.lock())
+        {
+            self->readAndProcessNVMeSensor();
+        }
     });
 }
 
