openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/rsyslog/8.1903.0-r0/rsyslog-8.1903.0/runtime/modules.c
static rsRetVal Release(const char* srcFile, modInfo_t** ppThis)
{
    DEFiRet;
    modInfo_t* pThis;

    assert(ppThis != NULL);
    pThis = *ppThis;
    assert(pThis != NULL);
    if (pThis->uRefCnt == 0)
    {
        /* oops, we are already at 0? */
        dbgprintf("internal error: module '%s' already has a refcount of 0 "
                  "(released by %s)!\n",
                  pThis->pszName, srcFile);
    }
    else
    {
        --pThis->uRefCnt;
        dbgprintf("file %s released module '%s', reference count now %u\n",
                  srcFile, pThis->pszName, pThis->uRefCnt);
#ifdef DEBUG
        modUsrDel(pThis, srcFile);
        modUsrPrint(pThis);
#endif
    }

    if (pThis->uRefCnt == 0)
    {
        /* we have a zero refcount, so we must unload the module */
        dbgprintf("module '%s' has zero reference count, unloading...\n",
                  pThis->pszName);
        modUnlinkAndDestroy(&pThis);
        /* we must NOT do a *ppThis = NULL, because ppThis now points into freed
         * memory! If in doubt, see obj.c::ReleaseObj() for how we are called.
         */
    }

    RETiRet;
}
/* Reference-Counting object access: subract one from the current refcount. Must
 * by called by anyone who no longer needs a module. If count reaches 0, the
 * module is unloaded. -- rgerhards, 20080-03-10
 */
Reference-Counting object access: subract one from the current refcount. Must
by called by anyone who no longer needs a module. If count reaches 0, the
module is unloaded.
Reference - Counting object access : subract one from the current refcount . Must by called by anyone who no longer needs a module . If count reaches 0 the module is unloaded .
static rsRetVal Release(const char* srcFile, modInfo_t** ppThis)
{
    DEFiRet;
    modInfo_t* pThis;
    assert(ppThis != NULL);
    pThis = *ppThis;
    assert(pThis != NULL);
    if (pThis->uRefCnt == 0)
    {
        dbgprintf("internal error: module '%s' already has a refcount of 0 "
                  "(released by %s)!\n",
                  pThis->pszName, srcFile);
    }
    else
    {
        --pThis->uRefCnt;
        dbgprintf("file %s released module '%s', reference count now %u\n",
                  srcFile, pThis->pszName, pThis->uRefCnt);
#ifdef DEBUG
        modUsrDel(pThis, srcFile);
        modUsrPrint(pThis);
#endif
    }
    if (pThis->uRefCnt == 0)
    {
        dbgprintf("module '%s' has zero reference count, unloading...\n",
                  pThis->pszName);
        modUnlinkAndDestroy(&pThis);
    }
    RETiRet;
}
static rsRetVal Release ( const char * srcFile , modInfo_t * * ppThis ) { DEFiRet ; modInfo_t * pThis ; assert ( ppThis != NULL ) ; pThis = * ppThis ; assert ( pThis != NULL ) ; if ( pThis -> uRefCnt == 0 ) { dbgprintf ( " " " \n " , pThis -> pszName , srcFile ) ; } else { -- pThis -> uRefCnt ; dbgprintf ( " \n " , srcFile , pThis -> pszName , pThis -> uRefCnt ) ; #ifdef DEBUG modUsrDel ( pThis , srcFile ) ; modUsrPrint ( pThis ) ; #endif } if ( pThis -> uRefCnt == 0 ) { dbgprintf ( " \n " , pThis -> pszName ) ; modUnlinkAndDestroy ( & pThis ) ; } RETiRet ; }
Reference-Counting object access: subract one from the current refcount.
Reference - Counting object access : subract one from the current refcount .
/* oops, we are already at 0? */ /* we have a zero refcount, so we must unload the module */ /* we must NOT do a *ppThis = NULL, because ppThis now points into freed
         * memory! If in doubt, see obj.c::ReleaseObj() for how we are called.
         */