Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 2C0F1475CB1 for ; Thu, 9 Jan 2003 06:13:24 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 87A55476421 for ; Thu, 9 Jan 2003 06:13:09 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id 6797F43A74A; Thu, 9 Jan 2003 06:13:09 -0500 (EST) From: Gerhard Hintermayer X-Newsgroups: comp.databases.postgresql.interfaces Subject: Re: still memory leaks with libpgtcl Date: Thu, 09 Jan 2003 12:06:33 +0100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 40 Message-ID: References: <785.1041999818@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@news.hub.org User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021130 X-Accept-Language: en-us, en In-Reply-To: To: pgsql-interfaces@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200301/54 X-Sequence-Number: 3554 Here's a short answer on my posting "deep Tcl_Channel question" to c.l.t. >>Can anybody of the tcl-gurus please enlighten me. >>I have a problem with the tcl extension to the postgreSQL database. >>The extension wraps a client channel around an existing TCP-Socket >>(which ist created by an external library). >>The problem is, that the closeProc of the created Tcl_Channel is >>sometimes called with interp NULL and sometimes with a valid interp. >>Some tcl-functions are very unhappy with passed NULL-interp (e.g. >>Tcl_DontCallWhenDeleted). >> >>My question is: When is the close proc passed a valid interp and when >>a NULL pointer as parameter ? >> >>Thanks >> >>Gerhard >Off hand, I think Tcl_Close() is called with a NULL interp when Tcl is >shutting down. Or, if the channel was never associated to a particular >interp with Tcl_RegisterChannel(). > >If you use Tcl_RegisterChannel(), you might not need to use a >Tcl_InterpDeleteProc for Tcl_CallWhenDeleted(). >-- >David Gravereaux >[species: human; planet: earth,milkyway,alpha sector] This is just like I did see it, in a normal interpreter shutdown and in case of an error interp is NULL, and a valid interp else. So I think it is ok, to check for NULL interp berfore calling Tcl functions that don't check for NULL pointers themselves. Tom are you happy with that explanation ? Gerhard