LWJGL Forum

Programming => Bug Reports / RFE => Topic started by: darkslave on December 28, 2016, 11:13:44

Title: [BUG] Assimp.aiReleaseImport throw NPE
Post by: darkslave on December 28, 2016, 11:13:44
When you try to release scene resources by calling method Assimp.aiReleaseImport it fails throwing NullPointerException:

java.lang.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.
Title: Re: [BUG] Assimp.aiReleaseImport throw NPE
Post by: spasi on December 28, 2016, 13:59:06
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());
Title: Re: [BUG] Assimp.aiReleaseImport throw NPE
Post by: darkslave on December 29, 2016, 16:43:48
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.
Title: Re: [BUG] Assimp.aiReleaseImport throw NPE
Post by: spasi on December 29, 2016, 17:02:43
Yes, those fields have been fixed (https://github.com/LWJGL/lwjgl3/commit/6cb0b271f7c0dcdae97a2a49c5b753fab35644f8) as well.

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