From ff672ca7c813b2ec0033775ce331d10f8849e070 Mon Sep 17 00:00:00 2001 From: Dev-Nash <56091931+Dev-Nash@users.noreply.github.com> Date: Thu, 6 Feb 2020 15:34:07 -0700 Subject: [PATCH 1/2] Update network.c Added method to free network from network* reference. Needed for C# integration. --- src/network.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/network.c b/src/network.c index d56bed5d..791a3a19 100644 --- a/src/network.c +++ b/src/network.c @@ -1029,6 +1029,11 @@ float network_accuracy_multi(network net, data d, int n) return acc; } +void free_network_ptr(network* net) +{ + free_network(*net); +} + void free_network(network net) { int i; From a25d4318366194d9d7cbb140e589e4ca88a2a621 Mon Sep 17 00:00:00 2001 From: Dev-Nash <56091931+Dev-Nash@users.noreply.github.com> Date: Thu, 6 Feb 2020 15:39:01 -0700 Subject: [PATCH 2/2] Update darknet.h Exposed new method with LIB_API. Needed for C# integration. --- include/darknet.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/darknet.h b/include/darknet.h index 2be89f05..89a9d55c 100644 --- a/include/darknet.h +++ b/include/darknet.h @@ -889,6 +889,7 @@ LIB_API network *load_network(char *cfg, char *weights, int clear); LIB_API network *load_network_custom(char *cfg, char *weights, int clear, int batch); LIB_API network *load_network(char *cfg, char *weights, int clear); LIB_API void free_network(network net); +LIB_API void free_network_ptr(network* net); // network.c LIB_API load_args get_base_args(network *net);