Fix clear() operation for rsScriptC.
- This removes a memory leak where some elements were not getting tracked
properly (and then triggering an assert when a context is destroyed).
- Convert ScriptCState to use a tracked object reference for mScript.
- Add a missing clear to FontState.
- Clean up synchronization in RSTest so that our graphics context outlives
any subtest context.
Change-Id: I0d5768c4d2f8810dd1ae2f68b1edd7e150f382fd
diff --git a/libs/rs/rsObjectBase.cpp b/libs/rs/rsObjectBase.cpp
index 48f1fee..713d61e 100644
--- a/libs/rs/rsObjectBase.cpp
+++ b/libs/rs/rsObjectBase.cpp
@@ -61,6 +61,7 @@
if (mRSC) {
remove();
}
+ rsAssert(rsc);
mRSC = rsc;
if (rsc) {
add();