free clones via delete instead of free
This commit is contained in:
@@ -32,6 +32,7 @@ Sort_Key_Condition :: struct {
|
||||
}
|
||||
|
||||
sort_key_condition_destroy :: proc(skc: ^Sort_Key_Condition) {
|
||||
delete(skc.sk_name) // Free the cloned string
|
||||
attr_value_destroy(&skc.value)
|
||||
if v2, ok := skc.value2.?; ok {
|
||||
v2_copy := v2
|
||||
@@ -46,6 +47,7 @@ Key_Condition :: struct {
|
||||
}
|
||||
|
||||
key_condition_destroy :: proc(kc: ^Key_Condition) {
|
||||
delete(kc.pk_name) // Free the cloned string
|
||||
attr_value_destroy(&kc.pk_value)
|
||||
if skc, ok := kc.sk_condition.?; ok {
|
||||
skc_copy := skc
|
||||
@@ -166,7 +168,8 @@ parse_key_condition_expression :: proc(
|
||||
t := tokenizer_init(expression)
|
||||
|
||||
pk_name_token := next_token(&t) or_return
|
||||
pk_name := resolve_attribute_name(pk_name_token, attribute_names) or_return
|
||||
pk_name_unowned := resolve_attribute_name(pk_name_token, attribute_names) or_return
|
||||
pk_name := strings.clone(pk_name_unowned) // Clone for safe storage
|
||||
|
||||
eq_token := next_token(&t) or_return
|
||||
if eq_token != "=" {
|
||||
@@ -219,7 +222,8 @@ parse_sort_key_condition :: proc(
|
||||
return
|
||||
}
|
||||
|
||||
sk_name := resolve_attribute_name(first_token, attribute_names) or_return
|
||||
sk_name_unowned := resolve_attribute_name(first_token, attribute_names) or_return
|
||||
sk_name := strings.clone(sk_name_unowned) // Clone for safe storage
|
||||
|
||||
op_token := next_token(t) or_return
|
||||
operator, op_ok := parse_operator(op_token)
|
||||
@@ -278,7 +282,8 @@ parse_begins_with :: proc(
|
||||
}
|
||||
|
||||
sk_name_token := next_token(t) or_return
|
||||
sk_name := resolve_attribute_name(sk_name_token, attribute_names) or_return
|
||||
sk_name_unowned := resolve_attribute_name(sk_name_token, attribute_names) or_return
|
||||
sk_name := strings.clone(sk_name_unowned) // Clone for safe storage
|
||||
|
||||
comma := next_token(t) or_return
|
||||
if comma != "," {
|
||||
|
||||
Reference in New Issue
Block a user