Project was created with 7.2 then upgraded to 7.5. The problem is, when u send from a port to a port includes more than one event, it randomly crashes. I have compared the codes between generated by 7.2 and generated by 7.5, Here is the diff:
7.2 :
bool Receiver::port_rcv_C::InBound_C::send(IOxfEvent* event, const IOxfEventGenerationParams& params) {
//#[ operation send(IOxfEvent*,const IOxfEventGenerationParams&)
bool res = false;
if (event != NULL) {
event->setPort(getPort());
if (itsInterfaceA != NULL) {
if (event->isTypeOf(evB1_Default_id)) {
res = itsInterfaceA->send(event, params);
return res;
}
}
if (itsInterfaceB != NULL) {
if (event->isTypeOf(evB2_Default_id)) {
res = itsInterfaceB->send(event, params);
return res;
}
}
}
return res;
//#]
}
7.5 :
bool Receiver::port_rcv_C::InBound_C::send(IOxfEvent* event, const IOxfEventGenerationParams& params) {
//#[ operation send(IOxfEvent*,const IOxfEventGenerationParams&)
bool res = false;
if (event != NULL) {
event->setPort(getPort());
if (itsInterfaceA != NULL) {
if (event->isTypeOf(evB1_Default_id)) {
res = itsInterfaceA->send(event, params);
}
}
if (itsInterfaceB != NULL) {
if (event->isTypeOf(evB2_Default_id)) {
res = itsInterfaceB->send(event, params);
}
}
}
return res;
//#]
}
The differences are the
return res; parts in the if states.
By the way, when run with 7.5, in the first if state, it deletes the event and crashes in the 2nd if state. Has anyone meet and solved the problem? How to force rhapsody to generate the if statements with else if at least? Finally the platform is Windows and there is no crash issue in vxworks.