内存泄漏问题,深拷贝

This commit is contained in:
lijun 2025-01-18 15:41:15 +08:00
parent a965a9dd7d
commit 318907eeac
1 changed files with 6 additions and 2 deletions

View File

@ -157,8 +157,14 @@ func GetDeviceCurrentFrameV3(deviceId int) (gocv.Mat, int) {
switch deviceId { switch deviceId {
case 1: case 1:
frame = Device1CurrentFrame frame = Device1CurrentFrame
//查看帧状态
log.Printf("frame:%v,Device1CurrentFrame:%v \n", frame.Empty(), Device1CurrentFrame.Empty())
case 50: case 50:
frame = Device50CurrentFrame frame = Device50CurrentFrame
//查看帧状态
log.Printf("frame:%v,Device50CurrentFrame:%v\n", frame.Empty(), Device50CurrentFrame.Empty())
} }
frame_countIface, ok := DeviceFrameCount.Load(deviceId) frame_countIface, ok := DeviceFrameCount.Load(deviceId)
@ -171,8 +177,6 @@ func GetDeviceCurrentFrameV3(deviceId int) (gocv.Mat, int) {
} }
//查看地址 //查看地址
log.Printf("frame:%p,Device1CurrentFrame:%p,Device50CurrentFrame:%p\n", &frame, &Device1CurrentFrame, &Device50CurrentFrame) log.Printf("frame:%p,Device1CurrentFrame:%p,Device50CurrentFrame:%p\n", &frame, &Device1CurrentFrame, &Device50CurrentFrame)
//查看帧状态
log.Printf("frame:%v,Device1CurrentFrame:%v,Device50CurrentFrame:%v\n", frame.Empty(), Device1CurrentFrame.Empty(), Device50CurrentFrame.Empty())
return frame, frame_count return frame, frame_count
} }
func GetDeviceCurrentFrame(deviceId int) (gocv.Mat, int) { func GetDeviceCurrentFrame(deviceId int) (gocv.Mat, int) {