R/onUnload.R

Defines functions .onUnload

## Execute on unloading

## release local variables

.onUnload <- function(libpath)
{
    if (length(.localVars$conn.id) > 0) {
        ## close all unclosed database connections
        for (i in .localVars$conn.id[,1])
            db.disconnect(conn.id = i, verbose = FALSE, force = TRUE)

        ## also unload all db connection drivers
        pkg.names <- names(.localVars$drv)
        for (pkg in pkg.names)
            .db.unloadDriver(pkg)
    }
    ## turn off the `special cbind()' :
    ## source(paste(.localVars$pkg.path, "/auto/disable.cbind2.R", sep = ""))
    ## eval(parse(text = "methods:::bind_activation(on = FALSE)"))
}

Try the PivotalR package in your browser

Any scripts or data that you put into this service are public.

PivotalR documentation built on March 13, 2021, 1:06 a.m.