DecodeImageMem was leaking memory because the mat header wasn't being deallocated.
This commit is contained in:
parent
3c1981582d
commit
7ddf7bb787
1 changed files with 1 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ import (
|
|||
func DecodeImageMem(data []byte) *IplImage {
|
||||
buf := CreateMatHeader(1, len(data), CV_8U)
|
||||
buf.SetData(unsafe.Pointer(&data[0]), CV_AUTOSTEP)
|
||||
defer buf.Release()
|
||||
|
||||
return DecodeImage(unsafe.Pointer(buf), CV_LOAD_IMAGE_UNCHANGED)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue