nsmcp::cleanup (private)

 nsmcp::cleanup

Defined in /usr/local/ns/tcl/nsmcp/examples/nsmcp-openacs-api-docs.tcl

Release nsmcp objects and resources associated with an interpreter.

Partial Call Graph (max 5 caller/called nodes):
Class ::nsmcp::HttpTransport Class ::nsmcp::HttpTransport (public) nsmcp::cleanup nsmcp::cleanup Class ::nsmcp::HttpTransport->nsmcp::cleanup Class ::nsmcp::Server Class ::nsmcp::Server (public) Class ::nsmcp::Server->nsmcp::cleanup nsmcp::HttpTransport instproc request nsmcp::HttpTransport instproc request (public) nsmcp::HttpTransport instproc request->nsmcp::cleanup nsmcp::Server instproc http nsmcp::Server instproc http (public) nsmcp::Server instproc http->nsmcp::cleanup nsf::object::exists nsf::object::exists nsmcp::cleanup->nsf::object::exists nsf::var::exists nsf::var::exists nsmcp::cleanup->nsf::var::exists nsf::var::set nsf::var::set nsmcp::cleanup->nsf::var::set

Testcases:
No testcase defined.
Source code:
    variable temporary
    if {![info exists temporary]} {
        return
    }
    set objects $temporary
    unset temporary
    foreach object [lreverse [dict keys $objects]] {
        # A destroyed anonymous command name may already refer to a persistent
        # object. Only sweep the exact lifetime registered by RequestClass::new.
        # Old name-only entries from a definition reload cannot prove ownership.
        if {[::nsf::object::exists $object]
            && [::nsf::var::exists $object __nsmcpRequestLifetime]
            && [::nsf::var::set $object __nsmcpRequestLifetime] eq [dict get $objects $object]} {
            if {[catch {
                $object destroy
            }]} {
                if {[info commands ns_log] ne ""} {
                    ns_log error "nsmcp: temporary object cleanup failed"
                }
                # Never return a potentially contaminated interpreter to pool.
                if {[info commands ns_ictl] ne ""} {
                    ns_ictl markfordelete
                }
            }
        }
    }
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: