certi-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[certi-cvs] certi/RTIA RTIA.cc RTIA_federate.cc


From: certi-cvs
Subject: [certi-cvs] certi/RTIA RTIA.cc RTIA_federate.cc
Date: Wed, 23 Apr 2008 12:55:06 +0000

CVSROOT:        /sources/certi
Module name:    certi
Changes by:     Eric NOULARD <erk>      08/04/23 12:55:06

Modified files:
        RTIA           : RTIA.cc RTIA_federate.cc 

Log message:
        Applied Petr Patch RTIA.patch
        from https://savannah.nongnu.org/bugs/?22798

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/RTIA.cc?cvsroot=certi&r1=3.17&r2=3.18
http://cvs.savannah.gnu.org/viewcvs/certi/RTIA/RTIA_federate.cc?cvsroot=certi&r1=3.71&r2=3.72

Patches:
Index: RTIA.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/RTIA.cc,v
retrieving revision 3.17
retrieving revision 3.18
diff -u -b -r3.17 -r3.18
--- RTIA.cc     23 Apr 2008 07:36:01 -0000      3.17
+++ RTIA.cc     23 Apr 2008 12:55:05 -0000      3.18
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: RTIA.cc,v 3.17 2008/04/23 07:36:01 siron Exp $
+// $Id: RTIA.cc,v 3.18 2008/04/23 12:55:05 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -131,6 +131,8 @@
 
         switch (n) {
           case 0:
+            delete msg_un ;
+            delete msg_tcp_udp ;
             break ;
           case 1:
             processNetworkMessage(msg_tcp_udp);
@@ -141,6 +143,8 @@
             delete msg_tcp_udp ;
             break ;
           case 3: // timeout
+            delete msg_un ;
+            delete msg_tcp_udp ;
             break ;
           default:
             assert(false);
@@ -154,7 +158,8 @@
             msg_un = new Message ;
 
             try {
-                if (isfinite(tm->_tick_timeout) && tm->_tick_timeout < 
LONG_MAX)
+                if (tm->_tick_timeout != 
std::numeric_limits<double>::infinity() &&
+                   tm->_tick_timeout < LONG_MAX)
                 {
                     struct timeval timev;
                     timev.tv_sec = int(tm->_tick_timeout);
@@ -176,15 +181,21 @@
 
             switch (n) {
               case 0:
+                delete msg_un;
+                delete msg_tcp_udp;
                 break ;
               case 1:
                 processNetworkMessage(msg_tcp_udp) ;  // could authorize a 
callbak
+                delete msg_un ;
                 // may have reset tm->_blocking_tick
                 processOngoingTick();
                 break ;
               case 2:
                 assert(false);
               case 3: // timeout
+                delete msg_un;
+                delete msg_tcp_udp;
+                // stop the ongoing tick() operation
                 tm->_blocking_tick = false;
                 processOngoingTick();
                 break ;
@@ -197,4 +208,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: RTIA.cc,v 3.17 2008/04/23 07:36:01 siron Exp $
+// $Id: RTIA.cc,v 3.18 2008/04/23 12:55:05 erk Exp $

Index: RTIA_federate.cc
===================================================================
RCS file: /sources/certi/certi/RTIA/RTIA_federate.cc,v
retrieving revision 3.71
retrieving revision 3.72
diff -u -b -r3.71 -r3.72
--- RTIA_federate.cc    23 Apr 2008 07:36:01 -0000      3.71
+++ RTIA_federate.cc    23 Apr 2008 12:55:06 -0000      3.72
@@ -18,7 +18,7 @@
 // along with this program ; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 //
-// $Id: RTIA_federate.cc,v 3.71 2008/04/23 07:36:01 siron Exp $
+// $Id: RTIA_federate.cc,v 3.72 2008/04/23 12:55:06 erk Exp $
 // ----------------------------------------------------------------------------
 
 #include <config.h>
@@ -1009,13 +1009,13 @@
 
     if (!tm->_blocking_tick)
     {
-        Message *msg_un = new Message;
+        Message msg_ack;
         if ( exc != e_RTIinternalError )
-           msg_un->setException(exc);
+           msg_ack.setException(exc);
         // terminate __tick() call in the federate
-        msg_un->type = Message::TICK_REQUEST;
-        msg_un->setBoolean(pending);
-        comm->requestFederateService(msg_un);
+        msg_ack.type = Message::TICK_REQUEST;
+        msg_ack.setBoolean(pending);
+        comm->requestFederateService(&msg_ack);
     }
 }
 
@@ -1377,4 +1377,4 @@
 
 }} // namespace certi/rtia
 
-// $Id: RTIA_federate.cc,v 3.71 2008/04/23 07:36:01 siron Exp $
+// $Id: RTIA_federate.cc,v 3.72 2008/04/23 12:55:06 erk Exp $




reply via email to

[Prev in Thread] Current Thread [Next in Thread]