From 68b1dbc0ea563d923aaf82df1bef097761b82aa7 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Sat, 27 Aug 2022 02:19:05 +0800 Subject: [PATCH] modeld: delete wide_frame in model_free (#25562) --- selfdrive/modeld/models/driving.cc | 1 + selfdrive/modeld/models/driving.h | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/selfdrive/modeld/models/driving.cc b/selfdrive/modeld/models/driving.cc index 9bf7e62184..8bfe584725 100644 --- a/selfdrive/modeld/models/driving.cc +++ b/selfdrive/modeld/models/driving.cc @@ -97,6 +97,7 @@ ModelOutput* model_eval_frame(ModelState* s, VisionBuf* buf, VisionBuf* wbuf, void model_free(ModelState* s) { delete s->frame; + delete s->wide_frame; } void fill_lead(cereal::ModelDataV2::LeadDataV3::Builder lead, const ModelOutputLeads &leads, int t_idx, float prob_t) { diff --git a/selfdrive/modeld/models/driving.h b/selfdrive/modeld/models/driving.h index d551bdf488..e2ee812e44 100644 --- a/selfdrive/modeld/models/driving.h +++ b/selfdrive/modeld/models/driving.h @@ -253,8 +253,8 @@ constexpr int NET_OUTPUT_SIZE = OUTPUT_SIZE + TEMPORAL_SIZE; // TODO: convert remaining arrays to std::array and update model runners struct ModelState { - ModelFrame *frame; - ModelFrame *wide_frame; + ModelFrame *frame = nullptr; + ModelFrame *wide_frame = nullptr; std::array output = {}; std::unique_ptr m; #ifdef DESIRE