From 936d7c4f28d68d3ad49723f9283e2cd0972f3707 Mon Sep 17 00:00:00 2001 From: Eric Katzfey Date: Wed, 26 Jul 2023 14:15:44 -0700 Subject: [PATCH] Fixed delete and non-null pointer bug --- src/drivers/gps/gps.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/drivers/gps/gps.cpp b/src/drivers/gps/gps.cpp index ae92000bfc..431a871f04 100644 --- a/src/drivers/gps/gps.cpp +++ b/src/drivers/gps/gps.cpp @@ -1031,6 +1031,7 @@ GPS::run() if ((_interface == GPSHelper::Interface::UART) && (_uart)) { (void) _uart->close(); delete _uart; + _uart = nullptr; #ifdef __PX4_LINUX