Fix refcounting bugs where the sys refcount
could be corrupted during async type creation.
Change-Id: If42828e92990598b0cb5da81c82ea513f94725f2
Fix stack object deletion bug.
Change-Id: I2c723aa5ad15e0c99dc9cd0cfbc7db80bace172a
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp
index a2910d7..165fa71 100644
--- a/libs/rs/rsScriptC.cpp
+++ b/libs/rs/rsScriptC.cpp
@@ -35,8 +35,6 @@
ScriptC::ScriptC(Context *rsc) : Script(rsc)
{
- mAllocFile = __FILE__;
- mAllocLine = __LINE__;
mBccScript = NULL;
memset(&mProgram, 0, sizeof(mProgram));
}
@@ -524,11 +522,11 @@
{
ScriptCState *ss = &rsc->mScriptC;
- ObjectBaseRef<ScriptC> s = ss->mScript.get();
+ ObjectBaseRef<ScriptC> s(ss->mScript);
ss->mScript.clear();
+ s->incUserRef();
ss->runCompiler(rsc, s.get());
- s->incUserRef();
ss->clear(rsc);
return s.get();
}