Fix driver mode memory leak with libpicam (#171)

This commit is contained in:
Declan Freeman-Gleason
2020-12-08 13:33:30 -05:00
committed by GitHub
parent e608d073bd
commit e4b6559b81

View File

@@ -64,6 +64,7 @@ public class DriverModePipeline
if (inputMat.channels() == 1 && PicamJNI.isSupported()) {
long colorMatPtr = PicamJNI.grabFrame(true);
if (colorMatPtr == 0) throw new RuntimeException("Got null Mat from GPU Picam driver");
inputMat.release();
inputMat = new Mat(colorMatPtr);
}