Re: [PyKDE] Re: clone member function deleting object

2005-03-17 Thread Phil Thompson
>> On Wed, 16 Mar 2005 14:12:55 - (GMT), "Phil Thompson" >> <[EMAIL PROTECTED]> said: > On Wed, 16 Mar 2005 09:42:36 - (GMT), "Phil Thompson" <[EMAIL PROTECTED]> said: >>> You use sipTransfer() - but you must call it before the Python object is garbage co

Re: [PyKDE] Re: clone member function deleting object

2005-03-16 Thread Paul F. Kunz
> On Wed, 16 Mar 2005 14:12:55 - (GMT), "Phil Thompson" <[EMAIL > PROTECTED]> said: >>> On Wed, 16 Mar 2005 09:42:36 - (GMT), "Phil Thompson" >>> <[EMAIL PROTECTED]> said: >> >>> You use sipTransfer() - but you must call it before the Python >>> object is garbage collected

Re: [PyKDE] Re: clone member function deleting object

2005-03-16 Thread Phil Thompson
>> On Wed, 16 Mar 2005 09:42:36 - (GMT), "Phil Thompson" >> <[EMAIL PROTECTED]> said: > > >> sipPySelf is the pointer to the Python instance object. It is reset >> to 0 to show that it has been garbage collected. Unfortunately, as >> you have found, it means the Python virtual reimpleme

Re: [PyKDE] Re: clone member function deleting object

2005-03-16 Thread Paul F. Kunz
> On Wed, 16 Mar 2005 09:42:36 - (GMT), "Phil Thompson" <[EMAIL > PROTECTED]> said: > sipPySelf is the pointer to the Python instance object. It is reset > to 0 to show that it has been garbage collected. Unfortunately, as > you have found, it means the Python virtual reimplementatio

Re: [PyKDE] Re: clone member function deleting object

2005-03-16 Thread Phil Thompson
>Using sip.transfer(), as Phil suggested, keeps the destructor of my > object created by clone() from being destroyed. However, my object > is still not useable as it can't find the Python implemented methods > when it is called from C++ after return of clone. > >Poking around, I found th

Re: [PyKDE] Re: clone member function deleting object

2005-03-15 Thread Paul F. Kunz
Using sip.transfer(), as Phil suggested, keeps the destructor of my object created by clone() from being destroyed. However, my object is still not useable as it can't find the Python implemented methods when it is called from C++ after return of clone. Poking around, I found that sipFunct

Re: [PyKDE] Re: clone member function deleting object

2005-03-15 Thread Paul F. Kunz
> On Tue, 15 Mar 2005 14:38:05 - (GMT), "Phil Thompson" <[EMAIL > PROTECTED]> said: > ...and it's virtual. I've eventually got it - I'm so used to > thinking about extending Python with C++ that I hadn't appreciated > properly that you are extending C++ with Python. Yes, it works bo

Re: [PyKDE] Re: clone member function deleting object

2005-03-15 Thread Phil Thompson
>> On Tue, 15 Mar 2005 09:09:02 - (GMT), "Phil Thompson" >> <[EMAIL PROTECTED]> said: > >>> I can't get to the sip documentation pages right now, >>> river-bank.demon.co.uk not responding. I can see from Python that >>> sip.transfer takes two arguments. What are they? > >> It seems t

Re: [PyKDE] Re: clone member function deleting object

2005-03-15 Thread Paul F. Kunz
> On Tue, 15 Mar 2005 09:09:02 - (GMT), "Phil Thompson" <[EMAIL > PROTECTED]> said: >> I can't get to the sip documentation pages right now, >> river-bank.demon.co.uk not responding. I can see from Python that >> sip.transfer takes two arguments. What are they? > It seems to be ba

Re: [PyKDE] Re: clone member function deleting object

2005-03-15 Thread Phil Thompson
>> On Mon, 14 Mar 2005 17:55:21 - (GMT), "Phil Thompson" >> <[EMAIL PROTECTED]> said: > On Mon, 14 Mar 2005 16:54:49 - (GMT), "Phil Thompson" <[EMAIL PROTECTED]> said: >>> You must either keep a reference or transfer ownership to C++ using sip.transfer()

Re: [PyKDE] Re: clone member function deleting object

2005-03-14 Thread Paul F. Kunz
> On Mon, 14 Mar 2005 17:55:21 - (GMT), "Phil Thompson" <[EMAIL > PROTECTED]> said: >>> On Mon, 14 Mar 2005 16:54:49 - (GMT), "Phil Thompson" >>> <[EMAIL PROTECTED]> said: >> >>> You must either keep a reference or transfer ownership to C++ >>> using sip.transfer() - and m

Re: [PyKDE] Re: clone member function deleting object

2005-03-14 Thread Phil Thompson
>> On Mon, 14 Mar 2005 16:54:49 - (GMT), "Phil Thompson" >> <[EMAIL PROTECTED]> said: > > >> You must either keep a reference or transfer ownership to C++ using >> sip.transfer() - and make sure you call the C++ dtor explicitly at >> some stage to avoid a memory leak. > >I'll try si

Re: [PyKDE] Re: clone member function deleting object

2005-03-14 Thread Paul F. Kunz
> On Mon, 14 Mar 2005 16:54:49 - (GMT), "Phil Thompson" <[EMAIL > PROTECTED]> said: > You must either keep a reference or transfer ownership to C++ using > sip.transfer() - and make sure you call the C++ dtor explicitly at > some stage to avoid a memory leak. I'll try sip.transfe

Re: [PyKDE] Re: clone member function deleting object

2005-03-14 Thread Phil Thompson
>> On Mon, 14 Mar 2005 15:34:04 - (GMT), "Phil Thompson" >> <[EMAIL PROTECTED]> said: > On Thu, 3 Mar 2005 09:17:07 - (GMT), "Phil Thompson" <[EMAIL PROTECTED]> said: >>> Enabling tracing with SIP, I get the following when I call the >>> clone() member function in

Re: [PyKDE] Re: clone member function deleting object

2005-03-14 Thread Paul F. Kunz
> On Mon, 14 Mar 2005 15:34:04 - (GMT), "Phil Thompson" <[EMAIL > PROTECTED]> said: >>> On Thu, 3 Mar 2005 09:17:07 - (GMT), "Phil Thompson" >>> <[EMAIL PROTECTED]> said: >> Enabling tracing with SIP, I get the following when I call the >> clone() member function in C++..

Re: [PyKDE] Re: clone member function deleting object

2005-03-14 Thread Phil Thompson
>> On Thu, 3 Mar 2005 09:17:07 - (GMT), "Phil Thompson" >> <[EMAIL PROTECTED]> said: > >Enabling tracing with SIP, I get the following when I call the > clone() member function in C++... > > FunctionBase * sipFunctionBase::clone() const (this=0x083b0878) > python.clone > sipFunction

[PyKDE] Re: clone member function deleting object

2005-03-14 Thread Paul F. Kunz
> On Thu, 3 Mar 2005 09:17:07 - (GMT), "Phil Thompson" <[EMAIL > PROTECTED]> said: Enabling tracing with SIP, I get the following when I call the clone() member function in C++... FunctionBase * sipFunctionBase::clone() const (this=0x083b0878) python.clone sipFunctionBase::sipFunc