[ Previous ] [ Contents ] [ Index ] [ Next ]

Ns_PdDbCleanup

Overview

Perform clean-up associated with DBMS handle.

Syntax

    void Ns_PdDbCleanup (void *handle);

Description

This function is called once from the 'nspdmain' when the database driver is being shut down just before the process exits. It performs cleanup associated with process shutdown and frees the database-specific handle.

This function is invoked during process shutdown, and the operating system may take care of garbage collecting malloc'ed memory, but you may want to use this function to provide specific database cleanup.

Psuedo-code Example

    /* Things italicized would be your DBMS-specific structures and 
calls. */
    void
    Ns_PdDbCleanup(void *handle) {
        DBMSState *state = (DBMSState *)handle;
         if (handle != NULL) {
    	    if (state->connected) {
    	        Ns_PdDbClose(handle);
    	    }		 
             free(state->sqlbuf);
             free(state);
        }
    }

Top of Page

[ Previous ] [ Contents ] [ Index ] [ Next ]
Copyright © 1998-99 America Online, Inc.