瀏覽代碼

Merge pull request #7812 from jakesmith/hpcc-14252

HPCC-14252 Clear up a few minor MP leaks.

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 9 年之前
父節點
當前提交
bb65e951b1
共有 1 個文件被更改,包括 18 次插入10 次删除
  1. 18 10
      system/mp/mpcomm.cpp

+ 18 - 10
system/mp/mpcomm.cpp

@@ -2414,7 +2414,7 @@ public:
         }
 
         CTimeMon tm(timeout);
-        Linked<CMPChannel> channel = parent->lookup(dst->endpoint());
+        Owned<CMPChannel> channel = parent->lookup(dst->endpoint());
         unsigned remaining;
         if (tm.timedout(&remaining))
             return false;
@@ -2428,7 +2428,7 @@ public:
     {
         CriticalBlock block(verifysect);
         CTimeMon tm(timeout);
-        Linked<CMPChannel> channel = parent->lookup(node->endpoint());
+        Owned<CMPChannel> channel = parent->lookup(node->endpoint());
         unsigned remaining;
         if (tm.timedout(&remaining))
             return false;
@@ -2471,7 +2471,7 @@ public:
                 else
                     doverify = (myrank<rank);
                 if (doverify) {
-                    Linked<CMPChannel> channel = parent->lookup(group->queryNode(rank).endpoint());
+                    Owned<CMPChannel> channel = parent->lookup(group->queryNode(rank).endpoint());
                     unsigned remaining;
                     if (tm.timedout(&remaining)) {
                         return false;
@@ -2486,7 +2486,7 @@ public:
             ForEachNodeInGroup(rank,*group) {
                 bool doverify = ((rank&1)==(myrank&1))?(myrank<rank):(myrank>rank);
                 if (doverify) {
-                    Linked<CMPChannel> channel = parent->lookup(group->queryNode(rank).endpoint());
+                    Owned<CMPChannel> channel = parent->lookup(group->queryNode(rank).endpoint());
                     while (!channel->verifyConnection(tm,false)) {
                         unsigned remaining;
                         if (tm.timedout(&remaining))
@@ -2584,7 +2584,7 @@ public:
     void disconnect(INode *node)
     {
         CriticalBlock block(verifysect);
-        Linked<CMPChannel> channel = parent->lookup(node->endpoint());
+        Owned<CMPChannel> channel = parent->lookup(node->endpoint());
         channel->closeSocket();
         parent->removeChannel(channel);
     }
@@ -2661,7 +2661,7 @@ public:
                 endrank = dstrank;
             for (;dstrank<=endrank;dstrank++) {
                 if (dstrank!=myrank) {
-                    Linked<CMPChannel> channel = getChannel(dstrank);
+                    Owned<CMPChannel> channel = getChannel(dstrank);
                     unsigned remaining;
                     if (tm.timedout(&remaining))
                         return false;
@@ -2730,7 +2730,7 @@ public:
         assertex(rank!=RANK_RANDOM);
         assertex(rank!=RANK_ALL);
         CTimeMon tm(timeout);
-        Linked<CMPChannel> channel = getChannel(rank);
+        Owned<CMPChannel> channel = getChannel(rank);
         unsigned remaining;
         if (tm.timedout(&remaining))
             return false;
@@ -2752,7 +2752,7 @@ public:
                 else
                     doverify = (myrank<rank);
                 if (doverify) {
-                    Linked<CMPChannel> channel = getChannel(rank);
+                    Owned<CMPChannel> channel = getChannel(rank);
                     unsigned remaining;
                     if (tm.timedout(&remaining)) {
                         return false;
@@ -2766,7 +2766,7 @@ public:
             ForEachNodeInGroup(rank,*group) {
                 bool doverify = ((rank&1)==(myrank&1))?(myrank<rank):(myrank>rank);
                 if (doverify) {
-                    Linked<CMPChannel> channel = getChannel(rank);
+                    Owned<CMPChannel> channel = getChannel(rank);
                     while (!channel->verifyConnection(tm,false)) {
                         unsigned remaining;
                         if (tm.timedout(&remaining))
@@ -2882,7 +2882,7 @@ public:
         }
             
         CTimeMon tm(timeout);
-        Linked<CMPChannel> channel = parent->lookup(mbuf.getSender());
+        Owned<CMPChannel> channel = parent->lookup(mbuf.getSender());
         unsigned remaining;
         if (tm.timedout(&remaining)) {
             return false;
@@ -2929,6 +2929,14 @@ ICommunicator *createCommunicator(IGroup *group,bool outer)
 }
 
 static IInterCommunicator *worldcomm=NULL;
+MODULE_INIT(INIT_PRIORITY_STANDARD)
+{
+    return true;
+}
+MODULE_EXIT()
+{
+    ::Release(worldcomm);
+}
 
 IInterCommunicator &queryWorldCommunicator()
 {