[BUG] Assimp.aiReleaseImport throw NPE

Started by darkslave, December 28, 2016, 11:13:44

Previous topic - Next topic


When you try to release scene resources by calling method Assimp.aiReleaseImport it fails throwing NullPointerException:

   at org.lwjgl.system.Checks.check(Checks.java:94)
   at org.lwjgl.assimp.AIScene.validate(AIScene.java:439)
   at org.lwjgl.assimp.Assimp.naiReleaseImport(Assimp.java:2560)
   at org.lwjgl.assimp.Assimp.aiReleaseImport(Assimp.java:2572)

the reason is that method AIScene.validate(AIScene.java:439) requires a pointer to animation buffer while the scene may not contain animation.


Thanks, will be fixed in the first 3.1.2 nightly build. In the meantime, you can use:

JNI.invokePV(Assimp.Functions.ReleaseImport, scene.address());


Also I want to draw your attention, that AIScene may not contain information about textures, lights, cameras.
I think the easiest way - is to ignore the check of mandatory fields.


Yes, those fields have been fixed as well.

The latest nightly (LWJGL 3.1.2 #1) includes the above.