That is not the correct way to iterate the scene materials. Also, AIMaterialProperty structs are not usually accessed by the user directly, the more convenient aiGetMaterial<property> functions are used instead. Example code:
PointerBuffer materials = scene.mMaterials(); // array of pointers to AIMaterial structs
for ( int i = 0; i < materials.remaining(); i++ ) {
AIMaterial material = AIMaterial.create(materials.get(i)); // wrap raw pointer in AIMaterial instance
// Method 1: use aiGetMaterial<property> functions, e.g.
int texCount = aiGetMaterialTextureCount(material, aiTextureType_DIFFUSE);
// Method 2: Parse material properties manually
PointerBuffer properties = material.mProperties(); // array of pointers to AIMaterialProperty structs
for ( int j = 0; j < properties.remaining(); j++ ) {
AIMaterialProperty prop = AIMaterialProperty.create(properties.get(j));
// parse property
}
}
Finally, material.close() or material.free() should not be called. The memory backing the materials is allocated by Assimp and is part of the AIScene object, it will be deallocated when you call aiReleaseImport(scene).