summaryrefslogtreecommitdiff
path: root/rsScriptC.cpp
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2012-02-02 13:23:20 -0800
committerStephen Hines <srhines@google.com>2012-02-02 13:23:20 -0800
commit4769d68bba1f2af113197ecd6d92ecdae090a6d7 (patch)
tree9c841ce08dd9753efc1997b2ae9049d673d831f2 /rsScriptC.cpp
parentd38f9254a345062dd44d910aa589f94e76d27092 (diff)
downloadrs-4769d68bba1f2af113197ecd6d92ecdae090a6d7.tar.gz
Properly recover from failed compilation.
BUG=5955072 We used to call delete, which did not update the Context's view of the world, leading to potential segfaults on Context teardown. This change also enables exceptions to be thrown when runtime errors are encountered. Change-Id: If63578efff2d7dd03639da1049c1a5ebc69fde35
Diffstat (limited to 'rsScriptC.cpp')
-rw-r--r--rsScriptC.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/rsScriptC.cpp b/rsScriptC.cpp
index 929dd683..b4eb995a 100644
--- a/rsScriptC.cpp
+++ b/rsScriptC.cpp
@@ -322,7 +322,7 @@ RsScript rsi_ScriptCCreate(Context *rsc,
if (!s->runCompiler(rsc, resName, cacheDir, (uint8_t *)text, text_length)) {
// Error during compile, destroy s and return null.
- delete s;
+ ObjectBase::checkDelete(s);
return NULL;
}