summaryrefslogtreecommitdiff
path: root/libs/rs/rsThreadIO.cpp
diff options
context:
space:
mode:
author Jason Sams <rjsams@android.com> 2009-09-25 14:51:22 -0700
committer Jason Sams <rjsams@android.com> 2009-09-25 14:51:22 -0700
commita9e7a05b84470257637c97d65f6562aa832c66ef (patch)
tree04a3175485ae7492c3387003c244953b6880c514 /libs/rs/rsThreadIO.cpp
parenta0cad2f5d19d95cfe496ebb82f3227dd4ed7c169 (diff)
Improve renderscript context teardown. Track object in the system and then force their cleanup by releasing all user references once destroy context is called. Java layer will no longer send destroy notifications for objects garbage collected once a context is destroyed.
Diffstat (limited to 'libs/rs/rsThreadIO.cpp')
-rw-r--r--libs/rs/rsThreadIO.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/libs/rs/rsThreadIO.cpp b/libs/rs/rsThreadIO.cpp
index 4072f066526d..964901a0426d 100644
--- a/libs/rs/rsThreadIO.cpp
+++ b/libs/rs/rsThreadIO.cpp
@@ -46,6 +46,10 @@ bool ThreadIO::playCoreCommands(Context *con, bool waitForCommand)
con->timerSet(Context::RS_TIMER_IDLE);
}
const void * data = mToCore.get(&cmdID, &cmdSize);
+ if (!cmdSize) {
+ // exception occured, probably shutdown.
+ return false;
+ }
if (con->logTimes) {
con->timerSet(Context::RS_TIMER_INTERNAL);
}