内存泄漏问题

This commit is contained in:
lijun 2025-01-18 15:26:04 +08:00
parent 6aeb4dd4f8
commit b8b6cb838c
2 changed files with 3 additions and 1 deletions

View File

@ -168,7 +168,7 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, device_id int) {
if c != count { if c != count {
//将img转[]byte //将img转[]byte
if img.Empty() { if img.Empty() {
log.Printf("device:%d img is empty!", device_id) log.Printf("device:%d img is empty! count = %d \n", device_id, c)
} else { } else {
//gocv.Matrix转为jpeg //gocv.Matrix转为jpeg
buf, err := gocv.IMEncode(".jpg", img) buf, err := gocv.IMEncode(".jpg", img)

View File

@ -165,6 +165,8 @@ func GetDeviceCurrentFrameV3(deviceId int) (gocv.Mat, int) {
if !ok { if !ok {
log.Printf("DeviceFrameCount 存储的不是 int 类型device_id: %d", deviceId) log.Printf("DeviceFrameCount 存储的不是 int 类型device_id: %d", deviceId)
} }
//查看地址
log.Printf("frame:%p,Device1CurrentFrame:%p,Device50CurrentFrame:%p\n", &frame, &Device1CurrentFrame, &Device50CurrentFrame)
return frame, frame_count return frame, frame_count
} }
func GetDeviceCurrentFrame(deviceId int) (gocv.Mat, int) { func GetDeviceCurrentFrame(deviceId int) (gocv.Mat, int) {