We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A memory leak is caused by not deleting the Adafruit_I2CDevice object in the deconstructor.
In begin() line ~66 an Adafruit_I2CDevice object is newed: i2c_dev = new Adafruit_I2CDevice(SHTC3_DEFAULT_ADDR, theWire);
i2c_dev = new Adafruit_I2CDevice(SHTC3_DEFAULT_ADDR, theWire);
The deconstructor fails to delete this object.
Adding the following in the deconstructor prevents the memory leak: if (i2c_dev) { delete i2c_dev; // remove old interface }
if (i2c_dev) { delete i2c_dev; // remove old interface }
The issue affects programs that call the library in a local method and the class goes out of scope in a looping fashion.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
A memory leak is caused by not deleting the Adafruit_I2CDevice object in the deconstructor.
In begin() line ~66 an Adafruit_I2CDevice object is newed:
i2c_dev = new Adafruit_I2CDevice(SHTC3_DEFAULT_ADDR, theWire);
The deconstructor fails to delete this object.
Adding the following in the deconstructor prevents the memory leak:
if (i2c_dev) { delete i2c_dev; // remove old interface }
The issue affects programs that call the library in a local method and the class goes out of scope in a looping fashion.
The text was updated successfully, but these errors were encountered: