Skip to content

Commit e992269

Browse files
authored
Free boxes (#122)
* #120 Correctly free boxes
1 parent 0cba55b commit e992269

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

app_httpd.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,12 @@ static int run_face_recognition(dl_matrix3du_t *image_matrix, box_array_t *net_b
238238
rgb_printf(image_matrix, FACE_COLOR_GREEN, "%s%u", knownFaceText, matched_id);
239239
} else {
240240
matched_id = -1;
241-
Serial.print("FACE: no match found: ");
241+
Serial.println("FACE: no match found:");
242242
rgb_printf(image_matrix, FACE_COLOR_RED, "%s", unknownFaceText);
243243
}
244244
}
245245
} else {
246-
Serial.print("FACE: not aligned: ");
246+
Serial.println("FACE: not aligned:");
247247
rgb_print(image_matrix, FACE_COLOR_YELLOW, "???");
248248
}
249249

@@ -400,6 +400,10 @@ static esp_err_t capture_handler(httpd_req_t *req){
400400
face_id = run_face_recognition(image_matrix, net_boxes);
401401
}
402402
draw_face_boxes(image_matrix, net_boxes, face_id);
403+
dl_lib_free(net_boxes->score);
404+
dl_lib_free(net_boxes->box);
405+
dl_lib_free(net_boxes->landmark);
406+
dl_lib_free(net_boxes);
403407
}
404408

405409
jpg_chunking_t jchunk = {req, 0};
@@ -512,6 +516,10 @@ static esp_err_t stream_handler(httpd_req_t *req){
512516
}
513517
fr_recognize = esp_timer_get_time();
514518
draw_face_boxes(image_matrix, net_boxes, face_id);
519+
dl_lib_free(net_boxes->score);
520+
dl_lib_free(net_boxes->box);
521+
dl_lib_free(net_boxes->landmark);
522+
dl_lib_free(net_boxes);
515523
}
516524
if(!fmt2jpg(image_matrix->item, fb->width*fb->height*3, fb->width, fb->height, PIXFORMAT_RGB888, 90, &_jpg_buf, &_jpg_buf_len)){
517525
Serial.println("STREAM: fmt2jpg failed");

src/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
/* Version of upstream code */
22

3-
char baseVersion[] = "3.2";
3+
char baseVersion[] = "3.2.1";

0 commit comments

Comments
 (0)