Improve renderscript context teardown. Track object in the system and then force their cleanup by releasing all user references once destroy context is called. Java layer will no longer send destroy notifications for objects garbage collected once a context is destroyed.
diff --git a/libs/rs/rsFileA3D.cpp b/libs/rs/rsFileA3D.cpp
index 347ef23..c566665 100644
--- a/libs/rs/rsFileA3D.cpp
+++ b/libs/rs/rsFileA3D.cpp
@@ -242,7 +242,7 @@
void FileA3D::processChunk_Mesh(Context *rsc, IO *io, A3DIndexEntry *ie)
{
- Mesh * m = new Mesh;
+ Mesh * m = new Mesh(rsc);
m->mPrimitivesCount = io->loadU32();
m->mPrimitives = new Mesh::Primitive_t *[m->mPrimitivesCount];