after free(), assign NULL.
authorsangho park <sangho.g.park@samsung.com>
Mon, 7 Mar 2011 11:28:13 +0000 (20:28 +0900)
committersangho park <sangho.g.park@samsung.com>
Mon, 7 Mar 2011 11:28:13 +0000 (20:28 +0900)
src/lib/elm_module.c

index 16d83b7..4c27be9 100644 (file)
@@ -181,9 +181,17 @@ _elm_module_unload(Elm_Module *m)
    eina_stringshare_del(m->so_path);
    eina_stringshare_del(m->data_dir);
    eina_stringshare_del(m->bin_dir);
-   if (m->shutdown_func) m->shutdown_func(m);
-   if (m->api) free(m->api);
-   if (m->handle) dlclose(m->handle);
+   if (m->api) {
+       free(m->api);   
+       m->api = NULL;
+   }
+   if (m->handle) {
+       if (m->shutdown_func) m->shutdown_func(m);
+       dlclose(m->handle);
+       m->handle = NULL;
+   }
+   m->shutdown_func = NULL;
+   m->init_func = NULL;
 }
 
 Elm_Module *