|
From: <fli...@go...> - 2011-08-31 07:32:20
|
Status: New Owner: ---- New issue 424 by bre...@gm...: AI objects in scenarios re-loading far too often without unloading, cmdarg().getPath() becoming corrupted. http://code.google.com/p/flightgear-bugs/issues/detail?id=424 *What steps will reproduce the problem?* 1. Load any scenario 2. Fly around above the scenario objects, fly out a ways from then & then back. *What is the expected output? What do you see instead?* After a while the scenario objects will re-initialize themselves, ie, re-run the code in their <nasal><load> section. This could be fairly normal--AI objects normally unload if you fly a long distance from them. The abnormal thing might be that they seem to unload far too quickly, when you are only a mile or two off, at most. The real difficulty is this: They never run the UNLOAD code (<nasal><unload>). So if the <load> section starts some timers or listeners, that are supposed to be destroyed when the <unload> code is run, that never happens. So it can be a major source of memory leak type things and slowdowns, as we add more & more listeners (every couple of minutes!) and never have the chance to get rid of the previous ones. *Any output in the console (black window)?* The best way to see this in action is load the Bombable package: http://www.flightgear.org/forums/viewtopic.php?f=6&t=5742 Then start flightgear Load scenario MarinCountyCamelInvasion1-Zoo.xml Choose aircraft Sopwith Camel YASim Choose Airport Marin Ranch. Once FG is started choose the Bombable menu and and check "Print debug messages to console". Note where the AI aircraft from the scenario are and fly around them, back and forth, as though in a dogfight with them. Over a period of 10 minutes or so you'll see a bunch of the AI objects re-initialize themselves 3 or 4 times. In the DOS console look for messages like this: Bombable: Attempt to re-initialize attributes when it has not been de-initialized; aborting re-initialization. [followed by the node name of the AI object] After a while you might even see this: Bombable: Attempt to initialize a Bombable subroutine on an object that is not AI or Multiplayer; aborting initialization. [followed by the node name of the AI object] This is where cmdarg().getPath(); from within the <nasal><load> code of an AI aircraft has suddenly switched to be the node of something wildly different, like something from /input/joysticks. This should never happen. I don't know if this is a related problem or just something being exposed by this other bug. *What FlightGear version are you using (when using GIT version, please mention date)?* FG 2.4.0. *What operating system and graphics card?* Windows, nVidia. *Please provide any additional information below or as attachment (Avoid expiring external links, such as to imageshack/pastebin/...).* |