some fixes

This commit is contained in:
2022-08-26 13:58:36 +06:00
parent 2ad5790a67
commit 03b9ede382
7 changed files with 11 additions and 10 deletions

View File

@@ -50,7 +50,8 @@ void Hashtable_expand(Hashtable* ht){
Autoarr(KVPair)* newar=newrows[newrown];
Autoarr_add(newar,p);
}
Autoarr_free(ar, true);
// there is no need to free array values, because they are copied into new array
__Autoarr_free_KVPair(ar, true);
}
free(ht->rows);

View File

@@ -17,7 +17,7 @@ void __KVPair_free(void* p){ KVPair_free(*(KVPair*)p); }
// func for KVP array clearing
void __Autoarr_free_KVPair_(Autoarr_KVPair* ar, bool freePtr){
Autoarr_foreach(ar,k,KVPair_free(k));
Autoarr_free(ar, freePtr);
__Autoarr_free_KVPair(ar, freePtr);
}
void ____Autoarr_free_KVPair_(void* ar){
__Autoarr_free_KVPair_((Autoarr_KVPair*)ar, false);