Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixed critical bug in shutdown()

  • Loading branch information...
commit 729c92d5d101855a92c4fda8a285d501cfd17c34 1 parent bc411df
Dominik Charousset authored August 22, 2012

Showing 1 changed file with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. 5  src/singleton_manager.cpp
5  src/singleton_manager.cpp
@@ -67,7 +67,10 @@ template<typename T>
67 67
 void stop_and_kill(std::atomic<T*>& ptr) {
68 68
     for (;;) {
69 69
         auto p = ptr.load();
70  
-        if (ptr.compare_exchange_weak(p, nullptr)) {
  70
+        if (p == nullptr) {
  71
+            return;
  72
+        }
  73
+        else if (ptr.compare_exchange_weak(p, nullptr)) {
71 74
             p->stop();
72 75
             delete p;
73 76
             ptr = nullptr;

0 notes on commit 729c92d

Please sign in to comment.
Something went wrong with that request. Please try again.