Re: [Deinterlace-discuss] Bugs in scheduling code
Brought to you by:
adcockj,
dschmelzer
|
From: Radoslav M. <rad...@se...> - 2007-03-01 15:08:27
|
>What happens if the object is destroyed but clearData is not called? >(hint: you should have made a destructor that deleted some variables >if you want to do it this way) > I thought about it but I don't want to delete m_name and m_name_program everytime when some Cschedule object is destroyed, just look more carefully at code...it will lead to error when I copy Cschedule object to another Cschedule object becouse at the end of function the destructor is called, so m_name would be removed and original Cschedule object would have bad pointers...and we don't want to make that happen >I don't agree with you and I suppose most programmers don't. It is >much simpler code to just define it as "char m_name[20]": no >drawbacks and no bugs or memory leaks. I didn't disagree in that, I told torsten that he is right but what I done that is a practice that some programmers uses (at the moment I'm not sure why so I can post arguments later, if there are any of course). Just look to book "Teaching yourself C++ in 21 days" in this books author often defines only pointers in classes not arrays in cases where you can put to class complete array definition. However if you wish to rewrite it I have no problem doing that. >What happens if the object is destroyed but clearData is not called? Please look to code....I cared about all memory clearing of Cschedule objects, they frees correctly. There aren't memory leaks at the moment as I know. However I enjoy that your team members approach to new code properly and searches for bugs....that is why is open source often better than comerical software....keep it going that way guys. Rado -----Original Message----- From: dei...@li... [mailto:dei...@li...] On Behalf Of Rob Muller Sent: Thursday, March 01, 2007 12:01 AM To: dei...@li... Subject: Re: [Deinterlace-discuss] Bugs in scheduling code At 20:52 25-02-07, Radoslav Masaryk wrote: >It's just matter of practice how I define arrays in classes. Char >m_name[20] instead of char* m_name in class looks a bit ugly to me, >don't know why. What happens if the object is destroyed but clearData is not called? (hint: you should have made a destructor that deleted some variables if you want to do it this way) I don't agree with you and I suppose most programmers don't. It is much simpler code to just define it as "char m_name[20]": no drawbacks and no bugs or memory leaks. Rob ------------------------------------------------------------------------ - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE V _______________________________________________ Deinterlace-discuss mailing list Dei...@li... https://lists.sourceforge.net/lists/listinfo/deinterlace-discuss |