pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Gerhard Hintermayer <g.hintermayer@inode.at>
To: pgsql-interfaces@postgresql.org
Subject: Re: still memory leaks with libpgtcl
Date: Thu, 09 Jan 2003 12:06:33 +0100
Message-ID: <avjlg4$28o0$1@news.hub.org> (raw)
In-Reply-To: <avikf6$2f0t$2@news.hub.org>
References: <785.1041999818@sss.pgh.pa.us>
	<avikf6$2f0t$2@news.hub.org>

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 <davygrvy@pobox.com>
 >[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




view thread (15+ messages)  latest in thread

Message-ID: <avjlg4$28o0$1@news.hub.org>
Permalink:  ../avjlg4$28o0$1@news.hub.org/
Also on:    postgresql.org/message-id/avjlg4$28o0$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: g.hintermayer@inode.at
  Subject: Re: still memory leaks with libpgtcl
  In-Reply-To: <avjlg4$28o0$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox