We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ac33747 commit 50d4e88Copy full SHA for 50d4e88
1 file changed
internal/adapter/http/controls/controls.go
@@ -57,7 +57,6 @@ func StreamVideoHandler(w http.ResponseWriter, r *http.Request) {
57
if err != nil {
58
http.Error(w, "Error capturing image: %v", http.StatusServiceUnavailable)
59
}
60
- // defer img.Close()
61
62
resizedFrame := gocv.NewMat()
63
@@ -73,7 +72,10 @@ func StreamVideoHandler(w http.ResponseWriter, r *http.Request) {
73
72
if _, err := partWriter.Write(buf.GetBytes()); err != nil {
74
log.Println("Error while processing buffer")
75
76
-
+
+ buf.Close()
77
+ resizedFrame.Close()
78
+ img.Close()
79
// we want to record around 10 fps
80
// this mean every second send 10 images
81
// Let's assume reading, encoding and writing do not consume any resources
0 commit comments