Hello Guest

[BUG] Assimp.aiReleaseImport throw NPE

  • 3 Replies
  • 1358 Views
[BUG] Assimp.aiReleaseImport throw NPE
« 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.

*

Offline spasi

  • *****
  • 2011
    • WebHotelier
Re: [BUG] Assimp.aiReleaseImport throw NPE
« Reply #1 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:

Code: [Select]
JNI.invokePV(Assimp.Functions.ReleaseImport, scene.address());

Re: [BUG] Assimp.aiReleaseImport throw NPE
« Reply #2 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.

*

Offline spasi

  • *****
  • 2011
    • WebHotelier
Re: [BUG] Assimp.aiReleaseImport throw NPE
« Reply #3 on: December 29, 2016, 17:02:43 »
Yes, those fields have been fixed as well.

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