Browse Source

MAVLink main: Fix resource leak for non-NuttX cases

sbg
Lorenz Meier 8 years ago
parent
commit
4939e42c0f
  1. 8
      src/modules/mavlink/mavlink_main.cpp

8
src/modules/mavlink/mavlink_main.cpp

@ -1,6 +1,6 @@
/**************************************************************************** /****************************************************************************
* *
* Copyright (c) 2012-2016 PX4 Development Team. All rights reserved. * Copyright (c) 2012-2017 PX4 Development Team. All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions * modification, are permitted provided that the following conditions
@ -460,7 +460,7 @@ Mavlink::destroy_all_instances()
while (_mavlink_instances) { while (_mavlink_instances) {
inst_to_del = _mavlink_instances; inst_to_del = _mavlink_instances;
LL_DELETE(_mavlink_instances, inst_to_del); LL_DELETE(_mavlink_instances, inst_to_del);
delete(inst_to_del); delete (inst_to_del);
} }
printf("\n"); printf("\n");
@ -2183,7 +2183,9 @@ Mavlink::task_main(int argc, char *argv[])
// the file stream. Since this is a one-time // the file stream. Since this is a one-time
// config thing, we leave the file struct // config thing, we leave the file struct
// allocated. // allocated.
//fclose(fs); #ifndef __PX4_NUTTX
fclose(fs);
#endif
} else { } else {
PX4_WARN("open fd %d failed", _uart_fd); PX4_WARN("open fd %d failed", _uart_fd);

Loading…
Cancel
Save