内存泄漏问题,新拷贝
This commit is contained in:
parent
1e8b72e9b2
commit
1d48452f23
|
|
@ -169,12 +169,14 @@ func GetDeviceCurrentFrameV3(deviceId int) (gocv.Mat, int) {
|
|||
var frame gocv.Mat
|
||||
switch deviceId {
|
||||
case 1:
|
||||
frame = Device1CurrentFrame
|
||||
frame = gocv.NewMatWithSize(Device1CurrentFrame.Rows(), Device1CurrentFrame.Cols(), Device1CurrentFrame.Type())
|
||||
Device1CurrentFrame.CopyTo(&frame)
|
||||
//查看帧状态
|
||||
log.Printf("frame:%v,Device1CurrentFrame:%v \n", frame.Empty(), Device1CurrentFrame.Empty())
|
||||
|
||||
case 50:
|
||||
frame = Device50CurrentFrame
|
||||
frame = gocv.NewMatWithSize(Device50CurrentFrame.Rows(), Device50CurrentFrame.Cols(), Device50CurrentFrame.Type())
|
||||
Device50CurrentFrame.CopyTo(&frame)
|
||||
//查看帧状态
|
||||
log.Printf("frame:%v,Device50CurrentFrame:%v\n", frame.Empty(), Device50CurrentFrame.Empty())
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue