You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
no compiler warning when deleting a BME280I2C object.
Actual behavior
warning: deleting object of polymorphic class type 'BME280I2C' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
delete BME280;
^~~~~~
Steps to reproduce the behavior
BME280I2C *BME280;
BME280 = new BME280I2C();
// ...
delete BME280;
Solution to avoid compiler warning
add virtual destructor in BME280I2C.h: virtual ~BME280I2C(){}
The text was updated successfully, but these errors were encountered:
Expected behavior
no compiler warning when deleting a BME280I2C object.
Actual behavior
warning: deleting object of polymorphic class type 'BME280I2C' which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
delete BME280;
^~~~~~
Steps to reproduce the behavior
Solution to avoid compiler warning
add virtual destructor in BME280I2C.h:
virtual ~BME280I2C(){}
The text was updated successfully, but these errors were encountered: