From 667fb848aa7f457adcfb5fd083309340dc1bf718 Mon Sep 17 00:00:00 2001 From: Shih-wei Liao Date: Thu, 16 Dec 2010 04:58:35 -0800 Subject: Whenever LoadBinary fails, recompile. Fixing the multi-instance bug. Change-Id: Ib1565efe1353ed788a3ed3c81c6067e92d8ef0e5 --- libs/rs/rsScriptC.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libs/rs/rsScriptC.cpp') diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp index 507430dfabc9..0ae85cba6100 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); -- cgit v1.2.3-59-g8ed1b