Hello Michael,

On 03/01/2012 10:24 AM, Carsten Neumann wrote:
On 02/29/2012 01:12 PM, Michael Raab wrote:
2.) If I have a ShadowViewport in the application that has at least one
light node attached and try to connect to a render server, the server
crashes in ShadowViewport::changed() when iterating the list of light
nodes. It seems some/all light nodes do not have a core assigned. That
looks to me probably like a similar sync problems as mentioned above.

that sounds as if some lights have not made it to the server or the
changed() function is called too early.
Do you call RemoteAspect::receiveSync(con, applyToChangelist) with
applyToChangelist == true? First glance it looks like in this case it
may call changed on containers before all of them are received, which
seems wrong.

attached is a patch that should correct this and only call changed after the complete sync has been received. Would you mind giving it a try? Thanks!

        Cheers,
                Carsten
Index: Source/System/Cluster/Base/OSGRemoteAspect.cpp
===================================================================
RCS file: /cvsroot/opensg/OpenSG/Source/System/Cluster/Base/OSGRemoteAspect.cpp,v
retrieving revision 1.46
diff -u -p -r1.46 OSGRemoteAspect.cpp
--- Source/System/Cluster/Base/OSGRemoteAspect.cpp	15 Jan 2010 15:23:55 -0000	1.46
+++ Source/System/Cluster/Base/OSGRemoteAspect.cpp	6 Mar 2012 00:16:29 -0000
@@ -215,7 +215,10 @@ void RemoteAspect::receiveSync(Connectio
     UInt32                              len;
 
     // hack. No materialchange after image chagne
-    std::vector<std::pair<FieldContainerPtr,BitVector> > changedFCs;
+    typedef std::pair  <FieldContainerPtr, BitVector>  ChangeStoreElem;
+    typedef std::vector<ChangeStoreElem>               ChangeStore;
+
+    ChangeStore changedFCs;
 
     if(_statistics)
     {
@@ -380,11 +383,6 @@ void RemoteAspect::receiveSync(Connectio
                 {
                     fcPtr = factory->getContainer(localId);
 
-                    if(applyToChangelist)
-                    {
-                        beginEditCP(fcPtr, mask);
-                    }
-
                     /*
                     for(int i=0;i<fcPtr->getType().getNumFieldDescs();i++)
                     {
@@ -394,18 +392,8 @@ void RemoteAspect::receiveSync(Connectio
                     }
                     */
                     fcPtr->copyFromBin(connection, mask);
-                    if(applyToChangelist)
-                    {
-                        endEditCP(fcPtr, mask);
-                    }
-                    else
-                    {
-                        // do we need to call this?
-                        changedCP(fcPtr, mask);
-                    }
-                    changedFCs.push_back(
-                        std::pair<FieldContainerPtr,BitVector>(
-                            fcPtr,mask));
+
+                    changedFCs.push_back(ChangeStoreElem(fcPtr, mask));
                 }
                 else
                 {
@@ -495,12 +483,22 @@ void RemoteAspect::receiveSync(Connectio
 
     // call changed for all changed field containers after all values
     // are set
-    for(std::vector<std::pair<FieldContainerPtr,BitVector> >::iterator cI=changedFCs.begin();
-        cI != changedFCs.end();
-        ++cI) 
+    ChangeStore::iterator cIt  = changedFCs.begin();
+    ChangeStore::iterator cEnd = changedFCs.end  ();
+
+    for(; cIt != cEnd; ++cIt)
     {
-        changedCP(cI->first,cI->second);
-        callChanged(cI->first);
+        if(applyToChangelist)
+        {
+            beginEditCP((*cIt).first, (*cIt).second);
+            endEditCP  ((*cIt).first, (*cIt).second);
+        }
+        else
+        {
+            changedCP((*cIt).first, (*cIt).second);
+        }
+
+        callChanged((*cIt).first);
     }
 
     // unregister mapper into factory
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to