On Dienstag 18 Oktober 2005 19:05, Melchior FRANZ wrote:
> * Erik Hofman -- Saturday 15 October 2005 16:51:
> > Mathias Froehlich:
> >
> > I had a quick view over the ssgBase::ref() calls in flightgear.
> > I made them all symmetric and used ssgDeRefDelete to dereference them.
>
> This patch (in four commit messages) has caused a serious regression:
> When using submodels, fgfs crashes within seconds. Try, for example,
> this line:
>
>   $ fgfs --aircraft=737 --vc=400 --altitude=20000
>
> and let the 737 dive. The contrails will now crash fgfs, as do other
> submodels, such as the seafire's smoke.
>
>   $ cvs up -D'2005/10/15 16:51:50'     --->  works
>
>   $ cvs up -D'2005/10/15 16:51:55'     --->  broken
Thanks for reporting.
Fixed by the attached patch.
Please apply.

   Greetings

        Mathias

-- 
Mathias Fröhlich, email: [EMAIL PROTECTED]
Index: src/AIModel/AIBase.cxx
===================================================================
RCS file: /var/cvs/FlightGear-0.9/source/src/AIModel/AIBase.cxx,v
retrieving revision 1.43
diff -u -r1.43 AIBase.cxx
--- src/AIModel/AIBase.cxx	15 Oct 2005 14:55:51 -0000	1.43
+++ src/AIModel/AIBase.cxx	18 Oct 2005 17:42:41 -0000
@@ -160,7 +160,6 @@
 			    prop_root,
 			    sim_time_sec);
       manager->setModel(path, model);
-      model->ref();
     }
   //else
   //  {
@@ -169,6 +168,10 @@
   //    aip.setVisible(false);
   //    globals->get_scenery()->get_scene_graph()->addKid(aip.getSceneGraph());
   // do some setModel stuff.
+  
+  if (model)
+    model->ref();
+
   return model;
 }
 
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@flightgear.org
http://mail.flightgear.org/mailman/listinfo/flightgear-devel
2f585eeea02e2c79d7b1d8c4963bae2d

Reply via email to