Re: still memory leaks with libpgtcl - Mailing list pgsql-interfaces

From Gerhard Hintermayer
Subject Re: still memory leaks with libpgtcl
Date
Msg-id avjlg4$28o0$1@news.hub.org
Whole thread Raw
In response to Re: still memory leaks with libpgtcl  (ljb <lbayuk@mindspring.com>)
List 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.>>Theextension wraps a client channel around an existing TCP-Socket>>(which ist created by an external
library).>>Theproblem is, that the closeProc of the created Tcl_Channel is>>sometimes called with interp NULL and
sometimeswith a valid interp.>>Some tcl-functions are very unhappy with passed NULL-interp
(e.g.>>Tcl_DontCallWhenDeleted).>>>>Myquestion is: When is the close proc passed a valid interp and when>>a NULL
pointeras 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
associatedto a particular>interp with Tcl_RegisterChannel().>>If you use Tcl_RegisterChannel(), you might not need to
usea>Tcl_InterpDeleteProc for Tcl_CallWhenDeleted().>-->David Gravereaux <davygrvy@pobox.com>>[species: human; planet:
earth,milkyway,alphasector]
 

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



pgsql-interfaces by date:

Previous
From: Graham Wilson
Date:
Subject: Recasting types
Next
From: "Key88 SF"
Date:
Subject: Re: libpqxx Large Objects