particle-iot / gps-ublox

Support for u-blox NEO-M8U with paired NMEA parser
Apache License 2.0
5 stars 2 forks source link

Fix memory leak when power cycling GNSS module #1

Closed eberseth closed 4 years ago

eberseth commented 4 years ago

Problem

The tx_ready_queue is getting reallocated when power cycling the GNSS module. Repeated calls to ubloxGPS::on() and ubloxGPS::off() reveal that there is reallocation of this queue when transitioning to the ON state.

Solution

Check if the tx_ready_queue is already allocated and only allocate it hasn't before.