Skip to content

Commit 4b42941

Browse files
author
Jason Sams
committed
Fix crash in ImageProcessing blend test
The blend test would use a stale context when running all tests. bug 7327728 Change-Id: I5802b9b382d8893419efe86d33fdfeeb27729e31
1 parent 3add43a commit 4b42941

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/Blend.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ public class Blend extends TestBase {
5252
new AdapterView.OnItemSelectedListener() {
5353
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
5454
currentIntrinsic = pos;
55-
runTest();
56-
act.updateDisplay();
55+
if (mRS != null) {
56+
runTest();
57+
act.updateDisplay();
58+
}
5759
}
5860

5961
public void onNothingSelected(AdapterView parent) {

tests/RenderScriptTests/ImageProcessing/src/com/android/rs/image/TestBase.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ public void finish() {
123123

124124
public void destroy() {
125125
mRS.destroy();
126+
mRS = null;
126127
}
127128

128129
public void updateBitmap(Bitmap b) {

0 commit comments

Comments
 (0)