bugCERTI - Bugs: bug #37721, Error:Object Class delete

 
 

bug #37721: Error:Object Class delete

Submitter:  YongChangShi <shijian>
Submitted:  Mon 12 Nov 2012 02:04:52 PM UTC
   
 
Category:  CERTI Severity:  * 3 - Normal
Item Group:  Software error Status:  Need Info
Privacy:  Public Assigned to:  erk
Open/Closed:  Closed Release:  * 3.4.1
Reproducibility:  Every Time Fixed Release:  * 3.4.1
* Mandatory Fields

Add a New Comment Rich Markup
   

Thu 02 Apr 2015 01:10:45 PM UTC, comment #2: 

Closing it because I lack the feedback info.

Eric NOULARD <erk>
Group administrator
Fri 27 Sep 2013 07:33:14 AM UTC, comment #1: 

Hi ShiJian,

Same as other bug report of yours.
Please explain what is the exact error/bug your are
trying to fix.

And provide a patch:
http://stackoverflow.com/questions/1648595/how-to-create-a-patch-file-on-windows

Eric NOULARD <erk>
Group administrator
Mon 12 Nov 2012 02:04:52 PM UTC, original submission:  

I have fiexed this bug. please check that!
file: ObjectClassSet.cc
function: killFederate

original:
void ObjectClassSet::killFederate(FederateHandle theFederate)
    throw ()
{
    ObjectClassBroadcastList *ocbList      = NULL ;
    ObjectClassHandle         currentClass = 0 ;

    handled_iterator i;

    for (i = fromHandle.begin(); i != fromHandle.end(); ++i) {
        // Call KillFederate on that class until it returns NULL.
        do {
            D.Out(pdExcept, "Kill Federate Handle %d .", theFederate);
            ocbList = i->second->killFederate(theFederate);

            D.Out(pdExcept, "Federate Handle %d Killed.", theFederate);

            // Broadcast RemoveObject message recursively
            if (ocbList != 0) {
                currentClass = i->second->getSuperclass();
                D.Out(pdExcept, "List not NULL");
                while (currentClass != 0) {
                    D.Out(pdRegister,
                          "Broadcasting Remove msg to parent class %d(Killed).",
                          currentClass);

                    // It may throw ObjectClassNotDefined
                    i->second = getObjectFromHandle(currentClass);

                    i->second->broadcastClassMessage(ocbList);

                    currentClass = i->second->getSuperclass();
                }

                delete ocbList ;
            }
        } while (ocbList != NULL);
    }
    D.Out(pdExcept, "End of the KillFederate Procedure.");
} /* end of killFederate */

fixed:
void ObjectClassSet::killFederate(FederateHandle theFederate)
    throw ()
{
/*ShiJian:Begin*/
ObjectClassBroadcastList *ocbList      = NULL ;
ObjectClassHandle         currentClassHandle = 0 ;
bool judge=false;//Added
ObjectClass* currentClass = NULL ;//Added

handled_iterator i;
for (i = fromHandle.begin(); i != fromHandle.end(); ++i) {

// Call KillFederate on that class until it returns NULL.
do {
D.Out(pdExcept, "Kill Federate Handle %d .", theFederate);

currentClass=i->second;
ocbList = currentClass->killFederate(theFederate);

judge=false;

D.Out(pdExcept, "Federate Handle %d Killed.", theFederate);


// Broadcast RemoveObject message recursively
if (ocbList != NULL) {
currentClassHandle = currentClass->getSuperclass();
D.Out(pdExcept, "List not NULL");
while (currentClassHandle != 0) {
D.Out(pdRegister,
"Broadcasting Remove msg to parent class %d(Killed).",
currentClassHandle);

// It may throw ObjectClassNotDefined
currentClass = getWithHandle(currentClassHandle);

currentClass->broadcastClassMessage(ocbList);

currentClassHandle = currentClass->getSuperclass();
}

judge=true;

delete ocbList ;
ocbList=NULL;
}
} while (judge);
}
D.Out(pdExcept, "End of the KillFederate Procedure.");
/*ShiJian:Begin*/


}

YongChangShi <shijian>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by erk (Posted a comment)
  • -email is unavailable- added by shijian (Submitted the item)
  •  

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-04-02 erk Open/ClosedOpen Closed
    2013-09-27 erk StatusNone Need Info
        Assigned toNone erk

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code