[odejava] further adventures with spaces

Hello,

After looking at other stuff for a while I decided to have another play with odejava and came upon the following problem. I was wondering if anyone else had experienced it. What is happening it this:

I am trying to remove a geom from a space like so

      
            Odejava.init();
            
            Space space = new Space();
            
            GeomBox box = new GeomBox(1.0f, 1.0f, 1.0f);
            
            space.addGeom(box);
            
            space.remove(box);

and I am getting the following error:


An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : EXCEPTION_ACCESS_VIOLATION (0xc0000005) occurred at PC=0x6D56D99
Function=dSpaceAdd+0x9
Library=C:\Code\Java\bin\odejava.dll

Am I doing something I shouldn’t here (or not doing something I should)? (which is possible at this time :slight_smile: )

Cheers,
Dan

Just as an add on to this the crash seems to be when the following code is called in Geom:



protected void removeFromSpace () {
            assert spaceId != Space.SPACEID_ZERO: "This   geom is already not in any Space";
            
            Ode.dSpaceRemove(spaceId, geomId);
            spaceId = Space.SPACEID_ZERO;
  Ode.dSpaceAdd(spaceId, geomId); <------ here

      }


I don’t know if this helps or not.

Dan.