Fixed use-after-free bug
authorkhizmax <libcds.dev@gmail.com>
Tue, 29 Nov 2016 19:51:31 +0000 (22:51 +0300)
committerkhizmax <libcds.dev@gmail.com>
Tue, 29 Nov 2016 19:51:31 +0000 (22:51 +0300)
cds/algo/flat_combining/kernel.h

index cbc39b778b7bb1d9409c8cbef31507962a860e3e..aa240004727cb8210dfccd0c8c25841a01b8d60a 100644 (file)
@@ -291,7 +291,9 @@ namespace cds { namespace algo {
             /// Destroys the objects and mark all publication records as inactive
             ~kernel()
             {
-                // mark all publication record as detached
+                m_pThreadRec.reset();   // calls tls_cleanup()
+
+                // delete all publication records
                 for ( publication_record* p = m_pHead; p; ) {
                     publication_record * pRec = p;
                     p = p->pNext.load( memory_model::memory_order_relaxed );