From 92a551b96e625257def26771155ebd64c6d8757e Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 29 Jun 2014 00:06:23 +0000 Subject: fixed not working singletons - still not threadsafe but at least they don't pretend to be --- src/routingTable.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/routingTable.cpp') diff --git a/src/routingTable.cpp b/src/routingTable.cpp index 82b302a..a802ecf 100644 --- a/src/routingTable.cpp +++ b/src/routingTable.cpp @@ -37,20 +37,12 @@ #include "routingTable.h" #include "routingTree.hpp" -RoutingTable* RoutingTable::inst = NULL; -Mutex RoutingTable::instMutex; RoutingTable& gRoutingTable = RoutingTable::instance(); - RoutingTable& RoutingTable::instance() { - Lock lock(instMutex); - static instanceCleaner c; - if(!inst) { - inst = new RoutingTable(); - } - - return *inst; + static RoutingTable instance; + return instance; } RoutingTable::RoutingTable() -- cgit v1.2.3