Commit 88203016 authored by Andreas Schmidt's avatar Andreas Schmidt
Browse files

Proper destroying of dataPacketStore.

parent 35b5c6f9
Pipeline #103 failed with stage
...@@ -13,6 +13,8 @@ PrrtDataPacketStore *PrrtDataPacketStore_create(void) ...@@ -13,6 +13,8 @@ PrrtDataPacketStore *PrrtDataPacketStore_create(void)
check_mem(store); check_mem(store);
check(pthread_mutex_init(&store->lock, NULL) == EXIT_SUCCESS, "Init mutex failed.") check(pthread_mutex_init(&store->lock, NULL) == EXIT_SUCCESS, "Init mutex failed.")
store->dataStore = NULL;
return store; return store;
error: error:
PERROR("Out of memory%s.",""); PERROR("Out of memory%s.","");
...@@ -43,7 +45,9 @@ bool PrrtDataPacketStore_destroy(PrrtDataPacketStore *store) ...@@ -43,7 +45,9 @@ bool PrrtDataPacketStore_destroy(PrrtDataPacketStore *store)
check(pthread_mutex_destroy(&store->lock) == EXIT_SUCCESS, "Destroy failed."); check(pthread_mutex_destroy(&store->lock) == EXIT_SUCCESS, "Destroy failed.");
if(store->dataStore != NULL) {
store->dataStore = BPTree_destroy(store->dataStore); store->dataStore = BPTree_destroy(store->dataStore);
}
free(store); free(store);
return true; return true;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment