--- src/interfaces/libpgtcl/pgtclId.c.bak	2002-10-17 10:53:32.000000000 -0400
+++ src/interfaces/libpgtcl/pgtclId.c	2003-01-07 21:51:53.000000000 -0500
@@ -300,12 +300,10 @@
 	 * small) amount of memory taken for the channel state representation.
 	 * Note we are not leaking a socket, since libpq closed that already.
 	 */
-#ifdef NOT_USED
 #if TCL_MAJOR_VERSION >= 8
-	if (connid->notifier_channel != NULL)
+	if (connid->notifier_channel != NULL && interp != NULL)
 		Tcl_UnregisterChannel(NULL, connid->notifier_channel);
 #endif
-#endif
 
 	/*
 	 * We must use Tcl_EventuallyFree because we don't want the connid
