mirror of https://github.com/ARMmbed/mbed-os.git
CFSTORE - Delete handle even if key ref non zero
When closing a file handle remove the handle from the handle list regardless of what the reference count of the key it is pointing to is. This prevents config store from keeping a handle to file handles that have gone out of scope.pull/3079/head
parent
5a5dbc2b31
commit
a37ccd1133
|
@ -2458,12 +2458,12 @@ static int32_t cfstore_file_destroy(cfstore_file_t* file)
|
||||||
if(cfstore_hkvt_get_flags_delete(&hkvt)){
|
if(cfstore_hkvt_get_flags_delete(&hkvt)){
|
||||||
ret = cfstore_delete_ex(&hkvt);
|
ret = cfstore_delete_ex(&hkvt);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* reset client buffer to empty ready for reuse */
|
/* reset client buffer to empty ready for reuse */
|
||||||
/* delete the file even if not deleting the KV*/
|
/* delete the file even if not deleting the KV*/
|
||||||
cfstore_listDel(&file->node);
|
cfstore_listDel(&file->node);
|
||||||
memset(file, 0, sizeof(cfstore_file_t));
|
memset(file, 0, sizeof(cfstore_file_t));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue