-
Notifications
You must be signed in to change notification settings - Fork 405
Open
Description
In function readCard is a possible memory leak, caused by removing of a modifier card.
When a modifier card is removed, only the activeModifier is set to null, but the memory is not freed.
Lines 1635 to 1642 in 73b5681
| if (tempCard.nfcFolderSettings.folder == 0) { | |
| if (activeModifier != NULL) { | |
| if (activeModifier->getActive() == tempCard.nfcFolderSettings.mode) { | |
| activeModifier = NULL; | |
| Serial.println(F("modifier removed")); | |
| if (isPlaying()) { | |
| mp3.playAdvertisement(261); | |
| } |
Should be fixed by using:
delete activeModifier;
Or the implementation of Modifier class could be changed to contain a destructor which gets called.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels