3ds loader prob or misunderstanding?

New Message Reply Date view Thread view Subject view Author view

Dewey Anderson (dewey++at++evt.com)
Wed, 20 Mar 1996 15:24:52 -0800


I'm having a crashing problem loading 3ds objects under certain circumstances.
 I'm not sure if it's a problem with the loader of if I'm just not cleaning up
my objects properly. I have boiled down the code to a simple example. The
basic "unit" is this:

  object = pfdLoadFile( "florida.3ds" );
  dcs.addChild( object );
  pfFrame();
  dcs.removeChild( object );
  pfDelete( object);

I have a simple scene graph that only has a single dcs to which I take turns
attaching different objects (object is a pfNode*). As you can see from the
code unit, I read in the object, attach it to the dcs, draw it, detach it and
delete it. This code unit is repeated 4 times in a row.

Here's the odd behavior: If those 4 units use the files florida.3ds,
florida.3ds, florida.3ds and arch.3ds respectively, the program crashes in the
4th call to pfdLoadFile with a segmentation violation (way down in some string
compare). If the order is florida, arch, florida, arch it works correctly. If
it's arch, arch, arch, florida it crashes on the 4th pfdLoadFile.

Here's the call stack at the crash:

strcmp()["strcmp.s":31]
GetContextByName3ds(<stripped>)["3dsfile.c":234]
OpenFile3ds(<stripped>)["pf3ds.c":98]
pfdLoadFile(<stripped>)["pfdLoadFile.c":768]
main()()["ptest_lin.C":66] (my main program)

I've tried a number of combinations and it's as if there's something about
starting off with 3 loads in a row of the same file that screws up the 4th
load.

My hope is that there's something I'm forgetting to do in the "cleanup" that
removes and deletes the object. Or maybe there's something I need to do for
using the 3ds loader that I'm not aware of.

Any help would be appreciated.

Dewey Anderson
Evolving Video Technologies
dewey++at++evt.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:52:34 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.