diff options
author | Shih-wei Liao <sliao@google.com> | 2010-12-16 04:58:35 -0800 |
---|---|---|
committer | Shih-wei Liao <sliao@google.com> | 2010-12-16 04:58:35 -0800 |
commit | 667fb848aa7f457adcfb5fd083309340dc1bf718 (patch) | |
tree | df95882ad7fd6d2d1bc0a48e8fcb129d0b6564ad /libs | |
parent | c32dd5f2d12107f3f1eff26dfd55a42d49c337de (diff) | |
download | frameworks_base-667fb848aa7f457adcfb5fd083309340dc1bf718.zip frameworks_base-667fb848aa7f457adcfb5fd083309340dc1bf718.tar.gz frameworks_base-667fb848aa7f457adcfb5fd083309340dc1bf718.tar.bz2 |
Whenever LoadBinary fails, recompile. Fixing the multi-instance bug.
Change-Id: Ib1565efe1353ed788a3ed3c81c6067e92d8ef0e5
Diffstat (limited to 'libs')
-rw-r--r-- | libs/rs/rsScriptC.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp index 507430d..0ae85cb 100644 --- a/libs/rs/rsScriptC.cpp +++ b/libs/rs/rsScriptC.cpp @@ -420,7 +420,14 @@ void ScriptCState::runCompiler(Context *rsc, ScriptC *s, const char *resName, co } else { // bccReadBC returns a neagative value: Didn't read any script, // So, use cached binary instead - bccLoadBinary(s->mBccScript); + if (bccLoadBinary(s->mBccScript)) { // LoadBinary fails ==> Recompile + bccReadBC(s->mBccScript, + s->mEnviroment.mScriptText, + s->mEnviroment.mScriptTextLength, + NULL, + cacheDir); + bccCompileBC(s->mBccScript); + } } bccGetScriptLabel(s->mBccScript, "root", (BCCvoid**) &s->mProgram.mRoot); bccGetScriptLabel(s->mBccScript, "init", (BCCvoid**) &s->mProgram.mInit); |