内存泄漏问题
This commit is contained in:
parent
6aeb4dd4f8
commit
b8b6cb838c
|
|
@ -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)
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue