fix unexisting trace error path
[lttv.git] / ltt / branches / poly / lttv / lttv / module.c
index a1826b91430e2255396d4f6a9f82278bc8c0772f..bc4f3de0c941ad923c040345795d8818c6bc1616 100644 (file)
 
 /* module.c : Implementation of the module loading/unloading mechanism. */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <lttv/module.h>
 #include <gmodule.h>
 
@@ -559,6 +563,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 +571,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++) {
This page took 0.023325 seconds and 4 git commands to generate.