summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Stephen Hines <srhines@google.com> 2012-02-02 13:23:20 -0800
committer Stephen Hines <srhines@google.com> 2012-02-02 13:23:20 -0800
commit862dadb7a7aa290e382ca02a376776e0e27987a1 (patch)
treebe6dc5f74a0fab8f2ca1a5001b508c9f468ae49c
parent07c12933e3859804a0da063c1111659285184bef (diff)
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
-rw-r--r--graphics/java/android/renderscript/RenderScript.java2
-rw-r--r--libs/rs/rsScriptC.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/graphics/java/android/renderscript/RenderScript.java b/graphics/java/android/renderscript/RenderScript.java
index ad10832b8966..03ad5aee4e0c 100644
--- a/graphics/java/android/renderscript/RenderScript.java
+++ b/graphics/java/android/renderscript/RenderScript.java
@@ -837,7 +837,7 @@ public class RenderScript {
mRS.mErrorCallback.mErrorNum = subID;
mRS.mErrorCallback.run();
} else {
- //throw new RSRuntimeException("Received error num " + subID + ", details: " + e);
+ throw new RSRuntimeException("Received error num " + subID + ", details: " + e);
}
continue;
}
diff --git a/libs/rs/rsScriptC.cpp b/libs/rs/rsScriptC.cpp
index 929dd683f306..b4eb995aed2f 100644
--- a/libs/rs/rsScriptC.cpp
+++ b/libs/rs/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;
}