Fix RS bug with message ID 0.

Clamp RSTest list to nice viewable range.

Change-Id: I0909511e16984ec78150cda17c22e22af1fa0cdb
This commit is contained in:
Stephen Hines
2010-09-24 14:38:30 -07:00
parent b0725a4aeb
commit ab98bb6e8b
6 changed files with 86 additions and 23 deletions

View File

@@ -601,9 +601,9 @@ public class RenderScript {
while(mRun) {
rbuf[0] = 0;
int msg = mRS.nContextGetMessage(mRS.mContext, rbuf, true);
if ((msg == 0) && mRun) {
if ((msg == 0)) {
// Can happen for two reasons
if (rbuf[0] > 0) {
if (rbuf[0] > 0 && mRun) {
// 1: Buffer needs to be enlarged.
rbuf = new int[rbuf[0] + 2];
} else {
@@ -616,6 +616,7 @@ public class RenderScript {
} catch(InterruptedException e) {
}
}
continue;
}
if(mRS.mMessageCallback != null) {
mRS.mMessageCallback.mData = rbuf;