内存泄漏解决测试
This commit is contained in:
parent
7e7cc07c4d
commit
1110ca1b9c
|
|
@ -213,15 +213,10 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, device_id int) {
|
||||||
//定时器,发送计数器
|
//定时器,发送计数器
|
||||||
t_count := 0
|
t_count := 0
|
||||||
t := 0
|
t := 0
|
||||||
log.Printf("device:%d send frame count:%d,img is closed", device_id, count)
|
|
||||||
//计算帧率
|
//计算帧率
|
||||||
for {
|
for {
|
||||||
//从service获取当前帧
|
//从service获取当前帧
|
||||||
img, c := service.GetDeviceCurrentFrameV3(device_id)
|
img, c := service.GetDeviceCurrentFrameV3(device_id)
|
||||||
t++
|
|
||||||
if t%10 == 0 {
|
|
||||||
log.Printf("device:%d send frame count:%d,img is closed", device_id, c)
|
|
||||||
}
|
|
||||||
if c != count {
|
if c != count {
|
||||||
if c == -1 {
|
if c == -1 {
|
||||||
log.Printf("device:%d get frame err!", device_id)
|
log.Printf("device:%d get frame err!", device_id)
|
||||||
|
|
@ -252,6 +247,10 @@ func subscribeAndHandleMessagesV3(ws *websocket.Conn, device_id int) {
|
||||||
if err5 != nil {
|
if err5 != nil {
|
||||||
log.Printf("img close err:%v", err)
|
log.Printf("img close err:%v", err)
|
||||||
}
|
}
|
||||||
|
t++
|
||||||
|
if t%50 == 0 {
|
||||||
|
log.Printf("device:%d send frame count:%d,img is closed", device_id, c)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//每秒发送一次心跳检测
|
//每秒发送一次心跳检测
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue