Skip to content

Commit 78b65aa

Browse files
author
Alrik Vidstrom
committed
Reset some static member variables in destructor
Some static member variables must be reset when the object is destroyed.
1 parent 525fdef commit 78b65aa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

libraries/BlockDevices/SDCardBlockDevice.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ SDCardBlockDevice::SDCardBlockDevice( pin_t _ck,
156156
/* DISTRUCTOR */
157157
/* -------------------------------------------------------------------------- */
158158
SDCardBlockDevice::~SDCardBlockDevice() {
159-
159+
// These static member variables must be reset when the oject is destroyed
160+
SDCardBlockDevice::card_inserted = false;
161+
SDCardBlockDevice::initialized = false;
162+
SDCardBlockDevice::st = CmdStatus::IN_PROGRESS;
160163
}
161164

162165
/* -------------------------------------------------------------------------- */

0 commit comments

Comments
 (0)