bluetooth control motor

Dependents:   BLE_LED_IDB0XA1_demo MOTOR_BLE_V2 Motor_Ble_v1 Motor_Ble_v10223 ... more

Fork of X_NUCLEO_IDB0XA1 by ST

Revision:
236:2a73f3a97452
Parent:
132:51056160fa4a
--- a/source/utils/Payload.cpp	Thu Jun 09 17:15:02 2016 +0200
+++ b/source/utils/Payload.cpp	Thu Jun 09 17:16:36 2016 +0200
@@ -98,4 +98,21 @@
         serializedAdData[i+1] = data[i];
     }
     return serializedAdData;
-}  
+}
+
+Payload::~Payload() {
+    int i = 0;
+
+    if(payload) {
+        while(i<payloadUnitCount) {
+            if(payload->data) {
+                delete[] payload->data;
+                payload->data = NULL;
+            }
+        }
+        delete[] payload;
+        payload = NULL;
+    }
+
+}
+