Changeset 1380:3d4feefdfb45


Ignore:
Timestamp:
10/17/09 01:10:13 (2 years ago)
Author:
niam
Branch:
default
Message:

call deinit module function in methods that get module information

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/libdodo/xexec.h

    r1373 r1380  
    6666                /** 
    6767                 * @struct __module__ 
    68                  * @brief is returned from moduleInit in the library 
     68                 * @brief is returned from initModule in the library 
    6969                 */ 
    7070                struct __module__ { 
     
    7676 
    7777                /** 
    78                  * @typedef moduleInit 
     78                 * @typedef initModule 
    7979                 * @brief defines type of init function for library 
    8080                 * @param data defines user data 
    8181                 * @note name in the library must be initXexecModule 
    8282                 */ 
    83                 typedef __module__ (*moduleInit)(void *data); 
    84  
    85                 /** 
    86                  * @typedef moduleDeinit 
     83                typedef __module__ (*initModule)(void *data); 
     84 
     85                /** 
     86                 * @typedef deinitModule 
    8787                 * @brief defines type of deinit function for library 
    8888                 * @note name in the library must be deinitXexecModule 
    8989                 */ 
    90                 typedef void (*moduleDeinit)(); 
     90                typedef void (*deinitModule)(); 
    9191#endif 
    9292 
  • trunk/src/exceptionBasic.cc

    r1374 r1380  
    10681068        __module__ mod = init(toInit); 
    10691069 
     1070        deinitModule deinit = (deinitModule)dlsym(handle, "deinitExceptionBasicModule"); 
     1071        if (deinit != NULL) 
     1072                deinit(); 
     1073 
    10701074#ifndef DL_FAST 
    10711075        if (dlclose(handle) != 0) 
  • trunk/src/xexec.cc

    r1373 r1380  
    7474{ 
    7575#ifdef DL_EXT 
    76         moduleDeinit deinit; 
     76        deinitModule deinit; 
    7777 
    7878        dodoList<__item__>::iterator i(preExec.begin()), j(preExec.end()); 
     
    8181                        continue; 
    8282 
    83                 deinit = (moduleDeinit)dlsym(i->handle, "deinitXexecModule"); 
     83                deinit = (deinitModule)dlsym(i->handle, "deinitXexecModule"); 
    8484                if (deinit != NULL) 
    8585                        deinit(); 
     
    9696                        continue; 
    9797 
    98                 deinit = (moduleDeinit)dlsym(i->handle, "deinitXexecModule"); 
     98                deinit = (deinitModule)dlsym(i->handle, "deinitXexecModule"); 
    9999                if (deinit != NULL) 
    100100                        deinit(); 
     
    143143#ifdef DL_EXT 
    144144        if (current->handle != NULL) { 
    145                 moduleDeinit deinit; 
    146  
    147                 deinit = (moduleDeinit)dlsym(current->handle, "deinitXexecModule"); 
     145                deinitModule deinit; 
     146 
     147                deinit = (deinitModule)dlsym(current->handle, "deinitXexecModule"); 
    148148                if (deinit != NULL) 
    149149                        deinit(); 
     
    225225                throw exception::basic(exception::MODULE_XEXEC, XEXECEX_MODULE, exception::ERRNO_DYNLOAD, 0, dlerror(), __LINE__, __FILE__); 
    226226 
    227         moduleInit init = (moduleInit)dlsym(handle, "initXexecModule"); 
     227        initModule init = (initModule)dlsym(handle, "initXexecModule"); 
    228228        if (init == NULL) 
    229229                throw exception::basic(exception::MODULE_XEXEC, XEXECEX_MODULE, exception::ERRNO_DYNLOAD, 0, dlerror(), __LINE__, __FILE__); 
     
    261261                throw exception::basic(exception::MODULE_XEXEC, XEXECEX_ADDXEXEC, exception::ERRNO_DYNLOAD, 0, dlerror(), __LINE__, __FILE__); 
    262262 
    263         moduleInit init = (moduleInit)dlsym(e.handle, "initXexecModule"); 
     263        initModule init = (initModule)dlsym(e.handle, "initXexecModule"); 
    264264        if (init == NULL) 
    265265                throw exception::basic(exception::MODULE_XEXEC, XEXECEX_ADDXEXEC, exception::ERRNO_DYNLOAD, 0, dlerror(), __LINE__, __FILE__); 
     
    284284                postExecId = e.id; 
    285285        } 
     286 
     287        deinitModule deinit = (deinitModule)dlsym(e.handle, "deinitXexecModule"); 
     288        if (deinit == NULL) 
     289                throw exception::basic(exception::MODULE_XEXEC, XEXECEX_ADDXEXEC, exception::ERRNO_DYNLOAD, 0, dlerror(), __LINE__, __FILE__); 
     290 
     291        deinit(); 
    286292} 
    287293 
Note: See TracChangeset for help on using the changeset viewer.