Jon,

I cannot reproduce this.
It just works for me with a plain cvs checkout
using that scenry tile from Scenery-0.9.8.

On Freitag 18 Februar 2005 01:24, Jon Stockill wrote:
> (gdb) bt
> #0  0x0ce8b760 in ?? ()
> #1  0x40142974 in __dynamic_cast (from=0xce8b760,
>      to=0x8548f9c <typeinfo for ssgBase>, require_public=139557448,
>      address=0x0, sub=0xbfffee80, subptr=0xbfffee8b)
>      at ../../gcc-2.95.3/gcc/cp/tinfo2.cc:282
> #2  0x081241cc in FGGroundCache::get_agl ()

From that backtrace:
There is exactly one dynamic_cast in this function.
In theory it should never happen that the argument to that dynamic_cast is 
zero.

Since I cannot reproduce it myself, can you help me?
Could you please apply the attached patch and tell me of some of thouse new 
cerr output lines triggers?

   Greetings

       Mathias

-- 
Mathias Fröhlich, email: [EMAIL PROTECTED]
Index: src/FDM/groundcache.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/FDM/groundcache.cxx,v
retrieving revision 1.4
diff -u -r1.4 groundcache.cxx
--- src/FDM/groundcache.cxx	17 Feb 2005 10:26:14 -0000	1.4
+++ src/FDM/groundcache.cxx	18 Feb 2005 15:01:29 -0000
@@ -114,7 +114,7 @@
         gp->type = FGInterface::Forest;
     }
   }
-  
+
   return gp;
 }
 
@@ -153,6 +153,18 @@
   // Check for magic texture names object names and such ...
   vtxa->setUserData( extractGroundProperty( l ) );
   vtxa->setCullFace( l->getCullFace() );
+
+  ssgBase *gpb = vtxa->getUserData();
+  // Assertation???
+  if ( !gpb ) {
+    cerr << "Newly created cache leaf without userdata!" << endl;
+  }
+  GroundProperty *gp = dynamic_cast<GroundProperty*>(gpb);
+  // Assertation???
+  if ( !gp ) {
+    cerr << "Newly created cache leaf where userdata is not a Ground property!" << endl;
+  }
+  
   // Finally append to cache.
   cache_root.addKid((ssgEntity*)vtxa);
 }
@@ -509,10 +521,18 @@
     // AGL computations are done with triangle/surface leafs.
     if (va->getPrimitiveType() != GL_TRIANGLES)
       continue;
-    GroundProperty *gp = dynamic_cast<GroundProperty*>(va->getUserData());
+    ssgBase *gpb = va->getUserData();
     // Assertation???
-    if ( !gp )
+    if ( !gpb ) {
+      cerr << "Found cache leaf without userdata!" << endl;
+      continue;
+    }
+    GroundProperty *gp = dynamic_cast<GroundProperty*>(gpb);
+    // Assertation???
+    if ( !gp ) {
+      cerr << "Found cache leaf where userdata is not a GroundProperty!" << endl;
       continue;
+    }
 
     int nt = va->getNumTriangles();
     for (int i=0; i < nt; ++i) {
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to