RE: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Bisz István
ds, István -Original Message- From: harbour-boun...@harbour-project.org [mailto:harbour-boun...@harbour-project.org] On Behalf Of Pritpal Bedi Sent: 2009. szeptember 16. 23:16 To: harbour@harbour-project.org Subject: RE: [Harbour] demoqt tests with debug_new - Leaked objects Hi B

Re: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Pritpal Bedi
Hi Franček Prijatelj wrote: > > By the way, you shuld newer call x->~TXobj directly. > You !!!MUST delete x > > Here is explanation > > http://www.parashift.com/c++-faq-lite/freestore-mgmt.html#faq-16.9 > Thanks for digging deep. Now exactly this approach I have implemented. Continue furthe

RE: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Pritpal Bedi
Hi Bisz István wrote: > > I executed the following test cases with debug_new: > > Case 1: > >// With this cpp function >// See: leakobj_with_delete.txt >HB_FUNC( QT_QRECT_DESTROY ) >{ > //hbqt_par_QRect( 1 )->~QRect(); > delete hbqt_par_QRect( 1 ); >} > > Ca

Re: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Franček Prijatelj
Hi By the way, you shuld newer call x->~TXobj directly. You !!!MUST delete x Here is explanation http://www.parashift.com/c++-faq-lite/freestore-mgmt.html#faq-16.9 BRGS Franček Franček Prijatelj wrote: > > Hi Pritpal > > This behavior is usual for any C++ program. > > Here is example: >

Re: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Franček Prijatelj
Hi Pritpal This behavior is usual for any C++ program. Here is example: #include using namespace std; class TRect { public: TRect(int t,int l,int w,int h) :_t(t),_l(l),_w(w),_h(h) {} int top()const { return _t; } int left() const { return _l; } int width() const { retu

RE: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Bisz István
To: Harbour Project Main Developer List. Subject: Re: [Harbour] demoqt tests with debug_new - Leaked objects Hi Pritpal, >> Is this a property of QT itself, or the property of >> Harbour wrappers? >> > > It is a property of Qt itself. > I have made extensive experiments a

Re: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Viktor Szakáts
Hi Pritpal, Is this a property of QT itself, or the property of Harbour wrappers? It is a property of Qt itself. I have made extensive experiments as far as Harbour's parameter passing is concerned and have reached to the conclusion that it is harmless. Experiments with Qt's object destructio

Re: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Pritpal Bedi
Hello Viktor Viktor Szakáts wrote: > > This means QT cannot be used in apps which is supposed > to run continuously. (?) > > Continuously running GUI apps aren't that typical, but > to me it's still a serious concern that and app just > eats memory while running. This makes it f.e. unsuitable

Re: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Viktor Szakáts
Hi Francek, Pritpal, Hi Victor In this particular case I see no problem. Maybe we want to keep a state in every tab. If not (maybe we are short on memory ..), we can delete objects when we loose focus on particular tab. Anyhow memory is reclaimed at the end of app. This means QT cannot be use

Re: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Franček Prijatelj
Hi Victor In this particular case I see no problem. Maybe we want to keep a state in every tab. If not (maybe we are short on memory ..), we can delete objects when we loose focus on particular tab. Anyhow memory is reclaimed at the end of app. Regards Franček Viktor Szakáts wrote: > > Hi F

Re: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Franček Prijatelj
Hi Pritpal You are right. My comment was regarding István's writing. He began thread writing about demoqt. Otherwise my compliments about Your great work. Regards Franček Pritpal Bedi wrote: > > Hi > > > Franček Prijatelj wrote: >> >> In STATIC FUNCTION Dialogs You are using local oDlg whi

Re: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Viktor Szakáts
Hi Francek, Okay, I see, although I'm still concerned that these objects are never freed, and if I'd like to free them, what is the right way to do it? Brgds, Viktor On 2009.09.16., at 10:33, Franček Prijatelj wrote: Hi Victor I wanted to say (one dirty solution ...) Here is another using s

Re: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Franček Prijatelj
Hi Victor I wanted to say (one dirty solution ...) Here is another using static instead of PUBLIC ... STATIC FUNCTION Dialogs( cType, w, l ) static oDlg,oDlg2,oDlg3,oDlg4,oDlg5,oDlg6 local oUrl DO CASE CASE cType == "PageSetup" if oDlg1 ==Nil oDlg1 := QPageSetupDialog():ne

Re: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Pritpal Bedi
Hi Franček Prijatelj wrote: > > In STATIC FUNCTION Dialogs You are using local oDlg which > is overwriten many times (you should delete QWidgets pointed to by it, > before allocating new ones) > > One solution (not going in other leaks) is this: > I never make tests on demoqt, all is based o

Re: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Viktor Szakáts
On 2009.09.16., at 10:16, Franček Prijatelj wrote: Hi Pritpal In STATIC FUNCTION Dialogs You are using local oDlg which is overwriten many times (you should delete QWidgets pointed to by it, before allocating new ones) One solution (not going in other leaks) is this: PROCEDURE Main() Loc

Re: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-16 Thread Franček Prijatelj
Hi Pritpal In STATIC FUNCTION Dialogs You are using local oDlg which is overwriten many times (you should delete QWidgets pointed to by it, before allocating new ones) One solution (not going in other leaks) is this: PROCEDURE Main() Local oLabel, oBtn, oDA, oTabBar Local oWnd, oSize

Re: [Harbour] demoqt tests with debug_new - Leaked objects

2009-09-14 Thread Pritpal Bedi
Hi István Bisz István wrote: > > The ‘demoqt’ tests with ‘debug_new’ shows a lot of ‘leaked objects’ , see > attached ‘debug_new.txt’. As I see now, the objects allocated by the new > operator are not released by a corresponding delete operator. > I am struggling with this aspect since 20 day