Update for latest nRF51822 code changes.
Dependencies: BLE_API nRF51822
Fork of Puck by
Revision 4:91506772210d, committed 2014-07-23
- Comitter:
- stiaje
- Date:
- Wed Jul 23 13:58:35 2014 +0000
- Parent:
- 3:5432b38585ea
- Child:
- 6:211ffef3b88e
- Commit message:
- Fix memory issue
Changed in this revision
Puck.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Puck.h Wed Jul 23 13:00:42 2014 +0000 +++ b/Puck.h Wed Jul 23 13:58:35 2014 +0000 @@ -92,6 +92,8 @@ std::vector<CharacteristicWriteCallback> pendingCallbackStack; std::vector<uint8_t*> pendingCallbackParameterStack; + GattCharacteristic **previousCharacteristics; + public: static Puck &getPuck(); @@ -252,11 +254,13 @@ } services.erase(services.begin() + removeIndex); delete service; + free(previousCharacteristics); } else { characteristicsLength = 1; characteristics = (GattCharacteristic**) malloc(sizeof(GattCharacteristic*) * characteristicsLength); } characteristics[characteristicsLength - 1] = characteristic; + previousCharacteristics = characteristics; service = new GattService(serviceUuid, characteristics, characteristicsLength); services.push_back(service); }