Revision: 43792
          http://brlcad.svn.sourceforge.net/brlcad/?rev=43792&view=rev
Author:   erikgreenwald
Date:     2011-03-08 21:05:55 +0000 (Tue, 08 Mar 2011)

Log Message:
-----------
update getListOfHandlers to work correctly with STL maps

Modified Paths:
--------------
    geomcore/trunk/src/libNet/NetMsgRouter.cxx

Modified: geomcore/trunk/src/libNet/NetMsgRouter.cxx
===================================================================
--- geomcore/trunk/src/libNet/NetMsgRouter.cxx  2011-03-08 21:01:07 UTC (rev 
43791)
+++ geomcore/trunk/src/libNet/NetMsgRouter.cxx  2011-03-08 21:05:55 UTC (rev 
43792)
@@ -77,15 +77,16 @@
 
 std::list<INetMsgHandler*>*
 NetMsgRouter::getListOfHandlers(uint16_t type) {
-       GSMutexLocker(&this->mapLock);
+    GSMutexLocker(&this->mapLock);
 
-       std::list<INetMsgHandler*>* l = this->routingTable->find(type)->second;
+    std::map<uint16_t,std::list<INetMsgHandler*>*>::iterator it = 
this->routingTable->find(type);
 
-       if (l == 0) {
-               l = new std::list<INetMsgHandler*> ();
-               
this->routingTable->insert(std::pair<int,std::list<INetMsgHandler*>*>(type, l));
-       }
+    if (it == this->routingTable->end()) {
+       std::list<INetMsgHandler*>* l = new std::list<INetMsgHandler*> ();
+       
this->routingTable->insert(std::pair<int,std::list<INetMsgHandler*>*>(type, l));
        return l;
+    }
+    return it->second;
 }
 
 void


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d
_______________________________________________
BRL-CAD Source Commits mailing list
brlcad-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to