diff options
author | Jason Sams <rjsams@android.com> | 2010-03-03 13:03:18 -0800 |
---|---|---|
committer | Jason Sams <rjsams@android.com> | 2010-03-03 14:14:37 -0800 |
commit | 156cce698093023d9e79a4ff4fb96f4e4d3019db (patch) | |
tree | ff5ce34e453d2f475bcab35d29f5a7d00d53554d /libs/rs/rsScript.cpp | |
parent | a034cd3e15b6626be03e60f2d6a0f929dcb950d9 (diff) |
Improve RS error handling. On errors RS will now store the error and a message that can be read from the app. RS will then not continue rendering frames while an unchecked error is present until new state is received.
Diffstat (limited to 'libs/rs/rsScript.cpp')
-rw-r--r-- | libs/rs/rsScript.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/rs/rsScript.cpp b/libs/rs/rsScript.cpp index cb1436b0bacd..a33933b689c8 100644 --- a/libs/rs/rsScript.cpp +++ b/libs/rs/rsScript.cpp @@ -96,6 +96,10 @@ void rsi_ScriptSetInvoke(Context *rsc, const char *name, uint32_t slot) void rsi_ScriptInvoke(Context *rsc, RsScript vs, uint32_t slot) { Script *s = static_cast<Script *>(vs); + if (s->mEnviroment.mInvokables[slot] == NULL) { + rsc->setError(RS_ERROR_BAD_SCRIPT, "Calling invoke on bad script"); + return; + } s->setupScript(); s->mEnviroment.mInvokables[slot](); } |