mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 05:33:34 +08:00
WIP: valgrind runtime analysis and fixes (#6521)
* Fix several valgrind identified mem leaks * Added callgrind target. * px4_posix_tasks use nullptr
This commit is contained in:
@@ -168,6 +168,11 @@ extern "C" {
|
||||
if (dev) {
|
||||
pthread_mutex_lock(&filemutex);
|
||||
ret = dev->close(filemap[fd]);
|
||||
|
||||
if (filemap[fd] != nullptr) {
|
||||
delete filemap[fd];
|
||||
}
|
||||
|
||||
filemap[fd] = nullptr;
|
||||
pthread_mutex_unlock(&filemutex);
|
||||
PX4_DEBUG("px4_close fd = %d", fd);
|
||||
|
||||
Reference in New Issue
Block a user