summaryrefslogtreecommitdiffhomepage
path: root/object.c
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2021-03-25 18:04:59 +0100
committerJo-Philipp Wich <jo@mein.io>2021-03-25 19:07:59 +0100
commit00d941954366bb8db14f1ee7d272814a986e4262 (patch)
tree88b0f22385937daf12408250834c1171fd7effd9 /object.c
parent20a3763d0a9a5efe6478595fe5590d47bffa90fe (diff)
vm: fix further memory leaks in trace mode
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'object.c')
-rw-r--r--object.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/object.c b/object.c
index 0616350..7748744 100644
--- a/object.c
+++ b/object.c
@@ -475,3 +475,19 @@ uc_ressource_prototype(json_object *jso)
return type ? type->proto : NULL;
}
+
+
+#ifdef __GNUC__
+
+__attribute__((destructor))
+static void uc_ressource_types_free(void)
+{
+ size_t i;
+
+ for (i = 0; i < res_types.count; i++)
+ uc_value_put(res_types.entries[i].proto->header.jso);
+
+ uc_vector_clear(&res_types);
+}
+
+#endif