From f8a129907d42592a6815df173c21f983be4c22e9 Mon Sep 17 00:00:00 2001 From: compudj Date: Mon, 15 Nov 2004 17:15:45 +0000 Subject: [PATCH] fix module.c bug git-svn-id: http://ltt.polymtl.ca/svn@836 04897980-b3bd-0310-b5e0-8ef037075253 --- ltt/branches/poly/lttv/lttv/module.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ltt/branches/poly/lttv/lttv/module.c b/ltt/branches/poly/lttv/lttv/module.c index a1826b91..e2d4d2ca 100644 --- a/ltt/branches/poly/lttv/lttv/module.c +++ b/ltt/branches/poly/lttv/lttv/module.c @@ -559,6 +559,7 @@ static void destroy() locked_libraries = g_new(LttvLibrary *, nb); for(i = 0 ; i < nb ; i++) { + //g_assert(nb == libraries->len); l = (LttvLibrary *)(libraries->pdata[i]); locked_libraries[i] = l; library_lock_loaded(l); @@ -566,7 +567,16 @@ static void destroy() m = (LttvModule *)(l->modules->pdata[j]); while(m->info.require_count > 0) lttv_module_release(m); } + library_unlock_loaded(l); while(l->info.load_count > 0) lttv_library_unload(l); + + /* If the number of librairies loaded have changed, restart from the + * beginning */ + if(nb != libraries->len) { + i = 0; + nb = libraries->len; + } + } for(i = 0 ; i < nb ; i++) { -- 2.34.1