One of my users encountered a crash that was caused by androidplot attempting to recycle a null Bitmap, bgBuffer. The version of androidplot was 1.5.5.
--------- beginning of crash
E/AndroidRuntime(28933): FATAL EXCEPTION: Androidplot renderThread
E/AndroidRuntime(28933): Process: biz.innomatix.bluefontz, PID: 28933
E/AndroidRuntime(28933): java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.Bitmap.
recycle()' on a null object reference
E/AndroidRuntime(28933): at com.androidplot.Plot$BufferedCanvas.recycle(Plot.java:240)
E/AndroidRuntime(28933): at com.androidplot.Plot$1.run(Plot.java:422)
E/AndroidRuntime(28933): at java.lang.Thread.run(Thread.java:818)
I haven't looked into the precise conditions that could cause this yet. An easy solution would be to just check for null:
public void recycle() {
if (bgBuffer != null) {
bgBuffer.recycle();
bgBuffer = null;
}
if (fgBuffer != null) {
fgBuffer.recycle();
fgBuffer = null;
}
System.gc();
}
This crash is probably pretty rare, I've never seen it myself while developing and testing.
One of my users encountered a crash that was caused by androidplot attempting to recycle a
null
Bitmap,bgBuffer
. The version of androidplot was 1.5.5.I haven't looked into the precise conditions that could cause this yet. An easy solution would be to just check for null:
This crash is probably pretty rare, I've never seen it myself while developing and testing.