Skip to content

Commit d2bffc0

Browse files
simo5abbra
authored andcommitted
Skip cleanup for built-in modules
Return early from verto_cleanup when BUILTIN_MODULE is defined. This prevents unloading module records and destroying global mutexes when the library is compiled statically, as dynamic module cleanup is unnecessary for built-in modules. Signed-off-by: Simo Sorce <simo@redhat.com>
1 parent 0dc4e8f commit d2bffc0

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/verto.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,9 @@ verto_free(verto_ctx *ctx)
610610
void
611611
verto_cleanup(void)
612612
{
613+
#ifdef BUILTIN_MODULE
614+
return;
615+
#else
613616
module_record *record;
614617

615618
mutex_lock(&loaded_modules_mutex);
@@ -624,6 +627,7 @@ verto_cleanup(void)
624627

625628
mutex_unlock(&loaded_modules_mutex);
626629
mutex_destroy(&loaded_modules_mutex);
630+
#endif
627631
}
628632

629633
void

0 commit comments

Comments
 (0)