v2.2.9 - add the destructor to resolve issue #135
This commit is contained in:
@@ -63,6 +63,31 @@ SFE_UBLOX_GNSS::SFE_UBLOX_GNSS(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
SFE_UBLOX_GNSS::~SFE_UBLOX_GNSS(void)
|
||||
{
|
||||
// Destructor
|
||||
|
||||
end(); // Delete all allocated memory - excluding payloadCfg, payloadAuto and spiBuffer
|
||||
|
||||
if (payloadCfg != NULL)
|
||||
{
|
||||
delete[] payloadCfg; // Created with new[]
|
||||
payloadCfg = NULL; // Redundant?
|
||||
}
|
||||
|
||||
if (payloadAuto != NULL)
|
||||
{
|
||||
delete[] payloadAuto; // Created with new[]
|
||||
payloadAuto = NULL; // Redundant?
|
||||
}
|
||||
|
||||
if (spiBuffer != NULL)
|
||||
{
|
||||
delete[] spiBuffer; // Created with new[]
|
||||
spiBuffer = NULL; // Redundant?
|
||||
}
|
||||
}
|
||||
|
||||
// Stop all automatic message processing. Free all used RAM
|
||||
void SFE_UBLOX_GNSS::end(void)
|
||||
{
|
||||
@@ -70,6 +95,8 @@ void SFE_UBLOX_GNSS::end(void)
|
||||
|
||||
// Note: payloadAuto is not deleted
|
||||
|
||||
// Note: spiBuffer is not deleted
|
||||
|
||||
if (ubxFileBuffer != NULL) // Check if RAM has been allocated for the file buffer
|
||||
{
|
||||
#ifndef SFE_UBLOX_REDUCED_PROG_MEM
|
||||
|
||||
Reference in New Issue
Block a user