MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / disconnect

Function disconnect

src/remote/client/interface.cpp:8516–8554  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8514}
8515
8516static void disconnect(rem_port* port, bool rmRef)
8517{
8518/**************************************
8519 *
8520 * d i s c o n n e c t
8521 *
8522 **************************************
8523 *
8524 * Functional description
8525 * Disconnect a port and free its memory.
8526 *
8527 **************************************/
8528
8529 finalize(port);
8530
8531 Rdb* rdb = port->port_context;
8532 port->port_context = nullptr;
8533
8534 // Clear context reference for the associated event handler
8535 // to avoid SEGV during shutdown
8536
8537 if (port->port_async)
8538 {
8539 port->port_async->port_context = NULL;
8540 port->port_async->port_flags |= PORT_disconnect;
8541 }
8542
8543 // Perform physical network disconnect and release
8544 // memory for remote database context.
8545
8546 port->port_flags |= PORT_disconnect;
8547 port->disconnect();
8548 delete rdb;
8549
8550 // Remove from active ports
8551
8552 if (rmRef)
8553 outPorts->unRegisterPort(port);
8554}
8555
8556
8557static THREAD_ENTRY_DECLARE event_thread(THREAD_ENTRY_PARAM arg)

Callers 4

freeClientDataMethod · 0.70
internalDropDatabaseMethod · 0.70
analyzeFunction · 0.70
initFunction · 0.70

Calls 3

finalizeFunction · 0.85
unRegisterPortMethod · 0.80
disconnectMethod · 0.45

Tested by

no test coverage detected