Skip to content

Commit

Permalink
fix: revert how to destroy RenderScript issue #103
Browse files Browse the repository at this point in the history
  • Loading branch information
wasabeef committed Dec 13, 2021
1 parent 0457c4d commit 2a2a8da
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions blurry/src/main/java/jp/wasabeef/blurry/Blur.java
Expand Up @@ -6,7 +6,6 @@
import android.graphics.Paint;
import android.graphics.PorterDuff;
import android.graphics.PorterDuffColorFilter;
import android.os.Build;
import android.renderscript.Allocation;
import android.renderscript.Element;
import android.renderscript.RSRuntimeException;
Expand Down Expand Up @@ -95,11 +94,7 @@ private static Bitmap rs(Context context, Bitmap bitmap, int radius) throws RSRu
output.copyTo(bitmap);
} finally {
if (rs != null) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
RenderScript.releaseAllContexts();
} else {
rs.destroy();
}
rs.destroy();
}
if (input != null) {
input.destroy();
Expand Down

0 comments on commit 2a2a8da

Please sign in to comment.