server/modules/selva/module.c
__attribute__((destructor))
int _Selva_OnUnload(void) {
    Selva_Onunload **onunload_p;

    SET_FOREACH(onunload_p, selva_onunld) {
        Selva_Onunload *onunload = *onunload_p;
        int err;

        err = onunload();
        if (err) {
            return err;
        }
    }

    return REDISMODULE_OK;
}
/*
 * Here we could use RedisModule_OnUnload() if it was called on exit, but it
 * isn't. Therefore, we use the destructor attribute that is almost always
 * called before the process terminates. As a side note, OnUnload would be never
 * called for Selva because Redis can't unload modules exporting types or
 * something.
 */
Here we could use RedisModule_OnUnload() if it was called on exit, but it
isn't. Therefore, we use the destructor attribute that is almost always
called before the process terminates. As a side note, OnUnload would be never
called for Selva because Redis can't unload modules exporting types or
something.
Here we could use RedisModule_OnUnload () if it was called on exit but it isn ' t . Therefore we use the destructor attribute that is almost always called before the process terminates . As a side note OnUnload would be never called for Selva because Redis can ' t unload modules exporting types or something .
__attribute__((destructor))
int _Selva_OnUnload(void) {
    Selva_Onunload **onunload_p;
    SET_FOREACH(onunload_p, selva_onunld) {
        Selva_Onunload *onunload = *onunload_p;
        int err;
        err = onunload();
        if (err) {
            return err;
        }
    }
    return REDISMODULE_OK;
}
__attribute__ ( ( destructor ) ) int _Selva_OnUnload ( void ) { Selva_Onunload * * onunload_p ; SET_FOREACH ( onunload_p , selva_onunld ) { Selva_Onunload * onunload = * onunload_p ; int err ; err = onunload ( ) ; if ( err ) { return err ; } } return REDISMODULE_OK ; }
Here we could use RedisModule_OnUnload() if it was called on exit, but it
 isn't.
Here we could use RedisModule_OnUnload () if it was called on exit but it isn ' t .