Skip to content

Commit

Permalink
Fix issue #67 printSensorDetails() issue (#68)
Browse files Browse the repository at this point in the history
* Remove delete objects instructions when the constructor is not empty

* removed comments because the test in the real device pass ok

* added validation before delete objects

* fix clang issue

* fix clang issue

* added missing validations for objects to delete

* restored fix after tests over two boards: TTGO T7 and M5StickC
  • Loading branch information
hpsaturn authored Jan 13, 2022
1 parent 486e1a8 commit 806f58f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Adafruit_BMP280.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ Adafruit_BMP280::~Adafruit_BMP280(void) {
delete spi_dev;
if (i2c_dev)
delete i2c_dev;
delete temp_sensor;
delete pressure_sensor;
if (temp_sensor == nullptr)
delete temp_sensor;
if (pressure_sensor == nullptr)
delete pressure_sensor;
}

/*!
Expand Down

0 comments on commit 806f58f

Please sign in to comment.