logreader: fix memory leak in Event (#22987)

old-commit-hash: 9cb46cc4a1
commatwo_master
Dean Lee 4 years ago committed by GitHub
parent 4ffc570eb8
commit 2d8780e5c6
  1. 7
      selfdrive/ui/replay/logreader.cc

@ -36,13 +36,12 @@ LogReader::LogReader(bool local_cache, int chunk_size, int retries, size_t memor
}
LogReader::~LogReader() {
#ifdef HAS_MEMORY_RESOURCE
delete mbr_;
::operator delete(pool_buffer_);
#else
for (Event *e : events) {
delete e;
}
#ifdef HAS_MEMORY_RESOURCE
delete mbr_;
::operator delete(pool_buffer_);
#endif
}

Loading…
Cancel
Save