Stash value before sending message-- message may be deleted immediately.
authorOrion Lawlor <olawlor@acm.org>
Thu, 20 Dec 2001 22:14:22 +0000 (22:14 +0000)
committerOrion Lawlor <olawlor@acm.org>
Thu, 20 Dec 2001 22:14:22 +0000 (22:14 +0000)
src/libs/ck-libs/tcharm/tcharm.C

index e2c14d69892d4948bcb11f757a9784455c4e3e95..eced8bfe9de8086ec284424dab9ef0e71cf5702d 100644 (file)
@@ -216,8 +216,9 @@ static void TCharmBuildThreads(TCharmInitMsg *msg,TCharmSetupCookie &cook)
                propMapID=CkCreatePropMap();
        }
        opts.setMap(propMapID);
                propMapID=CkCreatePropMap();
        }
        opts.setMap(propMapID);
+       int nElem=msg->numElements; //<- save it because msg will be deleted.
        CkArrayID id=CProxy_TCharm::ckNew(msg,opts);
        CkArrayID id=CProxy_TCharm::ckNew(msg,opts);
-       cook.setThreads(id,msg->numElements);
+       cook.setThreads(id,nElem);
 }
 
 /****** Readonlys *****/
 }
 
 /****** Readonlys *****/