From cad4bca73f494b8900f78961907d7f7cdc2265b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=EA=A6=AB=EA=A6=B6=EA=A6=8F=EA=A7=80=EA=A6=A6?= =?UTF-8?q?=EA=A6=BF=EA=A6=A7=EA=A6=AE=EA=A6=91=EA=A6=A9=EA=A6=AD=EA=A7=80?= Date: Sun, 12 Mar 2023 20:33:18 +0800 Subject: Revert "Product & order free-ers are now clearers" This reverts commit aca2dbad31d1c7d76f08344244013c507d657222. --- interchange.c | 4 ++-- interchange.h | 2 +- interchange/ord.h | 2 +- ord.c | 5 ++--- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/interchange.c b/interchange.c index 8718e20..b173614 100644 --- a/interchange.c +++ b/interchange.c @@ -67,7 +67,7 @@ void interchange_page(const char *path, void (*handler)(interchange_response *)) request(handler, NULL, NULL, "%s", path); } -void interchange_clear_product(struct interchange_product *product) +void interchange_free_product(struct interchange_product *product) { if (product->crosssell) for (size_t i = 0; i < product->crosssell->length; i++) @@ -92,7 +92,7 @@ void interchange_clear_product(struct interchange_product *product) void interchange_free_catalog(struct interchange_catalog *catalog) { for (size_t i = 0; i < catalog->length; i++) - interchange_clear_product(&catalog->products[i]); + interchange_free_product(&catalog->products[i]); free(catalog); } diff --git a/interchange.h b/interchange.h index 2775613..e890708 100644 --- a/interchange.h +++ b/interchange.h @@ -65,7 +65,7 @@ void interchange_product(const char *sku, void (*handler)(interchange_response * void interchange_page(const char *path, void (*handler)(interchange_response *)); -void interchange_clear_product(struct interchange_product *product); +void interchange_free_product(struct interchange_product *product); void interchange_free_catalog(struct interchange_catalog *catalog); diff --git a/interchange/ord.h b/interchange/ord.h index d94c474..ed7933d 100644 --- a/interchange/ord.h +++ b/interchange/ord.h @@ -47,7 +47,7 @@ void interchange_ord_checkout(const char *order_profile, const struct interchange_member *member, void (*handler)(interchange_response *)); -void interchange_ord_clear_order(struct interchange_ord_order *order); +void interchange_ord_free_order(struct interchange_ord_order *order); void interchange_ord_free_transaction(struct interchange_ord_transaction *transaction); diff --git a/ord.c b/ord.c index b5d766e..9c13c93 100644 --- a/ord.c +++ b/ord.c @@ -33,12 +33,11 @@ void interchange_ord_checkout(const char *order_profile, }}, "%s", "ord/checkout"); } -void interchange_ord_clear_order(struct interchange_ord_order *order) +void interchange_ord_free_order(struct interchange_ord_order *order) { - for (size_t i = 0; i < order->nitems; i++) - interchange_clear_product(&order->items[i].product); if (order->profile) free(order->profile); + free(order); } void interchange_ord_free_transaction(struct interchange_ord_transaction -- cgit v1.2.3