PR_DestroyLock(vr_lock); vr_lock = NULL;
VR_INTERFACE(void) NR_ShutdownRegistry(void){    REGFILE* pReg;#ifndef STANDALONE_REGISTRY    /* people should track whether NR_StartupRegistry() was successful     * and not call this if it fails... but they won't so we'll try to     * handle that case gracefully.     */    if ( reglist_lock == NULL )         return;  /* was not started successfully */#endif    PR_Lock( reglist_lock );    --regStartCount;    if ( regStartCount == 0 )    {        /* shutdown for real. */        /* Close version registry first */#ifndef STANDALONE_REGISTRY        if ( vr_monitor != NULL )         {            VR_Close();            PR_DestroyMonitor(vr_monitor);            vr_monitor = NULL;        }#endif         /* close any forgotten open registries */        while ( RegList != NULL )         {            pReg = RegList;            if ( pReg->hdrDirty ) {                nr_WriteHdr( pReg );            }            nr_CloseFile( &(pReg->fh) );            nr_DeleteNode( pReg );        }            XP_FREEIF(user_name);        XP_FREEIF(globalRegName);    }    PR_Unlock( reglist_lock );#ifndef STANDALONE_REGISTRY        if ( regStartCount == 0 )     {        PR_DestroyLock( reglist_lock );        reglist_lock = NULL;    }#endif}   /* NR_ShutdownRegistry */