diff options
Diffstat (limited to 'src/interfaces/libpgtcl/pgtclCmds.c')
-rw-r--r-- | src/interfaces/libpgtcl/pgtclCmds.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/interfaces/libpgtcl/pgtclCmds.c b/src/interfaces/libpgtcl/pgtclCmds.c index a87cb1842cb..8fef8732fd6 100644 --- a/src/interfaces/libpgtcl/pgtclCmds.c +++ b/src/interfaces/libpgtcl/pgtclCmds.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.56 2001/08/10 22:50:10 tgl Exp $ + * $Header: /cvsroot/pgsql/src/interfaces/libpgtcl/Attic/pgtclCmds.c,v 1.57 2001/09/06 02:54:56 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -403,6 +403,8 @@ Pg_connect(ClientData cData, Tcl_Interp *interp, int argc, char *argv[]) int Pg_disconnect(ClientData cData, Tcl_Interp *interp, int argc, char *argv[]) { + Pg_ConnectionId *connid; + PGconn *conn; Tcl_Channel conn_chan; if (argc != 2) @@ -419,6 +421,12 @@ Pg_disconnect(ClientData cData, Tcl_Interp *interp, int argc, char *argv[]) return TCL_ERROR; } +#if TCL_MAJOR_VERSION >= 8 + conn = PgGetConnectionId(interp, argv[1], &connid); + if (connid->notifier_channel != NULL) + Tcl_UnregisterChannel(interp, connid->notifier_channel); +#endif + return Tcl_UnregisterChannel(interp, conn_chan); } |