Skip to content

Commit 8c192bf

Browse files
committed
Wire: nullify pointers on end()
1 parent 84bd6b2 commit 8c192bf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: libraries/Wire/Wire.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,15 @@ void arduino::MbedI2C::begin(uint8_t slaveAddr) {
4545
void arduino::MbedI2C::end() {
4646
if (master != NULL) {
4747
delete master;
48+
master = NULL;
4849
}
4950
#ifdef DEVICE_I2CSLAVE
5051
if (slave != NULL) {
5152
slave_th->terminate();
5253
slave_th->free_stack();
5354
delete slave_th;
5455
delete slave;
56+
slave = NULL;
5557
}
5658
#endif
5759
}

0 commit comments

Comments
 (0)