Skip site navigation (1) Skip section navigation (2)

Re: still memory leaks with libpgtcl

From: Gerhard Hintermayer <g(dot)hintermayer(at)inode(dot)at>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: Re: still memory leaks with libpgtcl
Date: 2003-01-09 11:06:33
Message-ID: avjlg4$28o0$1@news.hub.org (view raw or flat)
Thread:
Lists: pgsql-interfaces
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(at)pobox(dot)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


In response to

pgsql-interfaces by date

Next:From: Key88 SFDate: 2003-01-09 18:04:14
Subject: Re: libpqxx Large Objects
Previous:From: Graham WilsonDate: 2003-01-09 10:50:08
Subject: Recasting types

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group