My fork of X_NUCLEO_IDB0XA1
Fork of X_NUCLEO_IDB0XA1 by
Diff: x-nucleo-idb0xa1/utils/Payload.h
- Revision:
- 236:2a73f3a97452
- Parent:
- 175:925e455f5e45
- Child:
- 242:058b2e731adc
- Child:
- 251:86df2c289e7c
--- a/x-nucleo-idb0xa1/utils/Payload.h Thu Jun 09 17:15:02 2016 +0200 +++ b/x-nucleo-idb0xa1/utils/Payload.h Thu Jun 09 17:16:36 2016 +0200 @@ -67,6 +67,7 @@ public: Payload(const uint8_t *tokenString, uint8_t string_ength); Payload(); + ~Payload(); uint8_t getPayloadUnitCount(); uint8_t getIDAtIndex(int index); @@ -180,7 +181,11 @@ int getPayloadUnitCount() { return payloadUnitCount; } - + ~PayloadPtr() { + if(unit) delete[] unit; + + unit = NULL; + } }; #endif // __PAYLOAD_H__