[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: free instead of destructor
From:       Michael Koch <m_koch () bigfoot ! de>
Date:       2000-02-07 16:22:02
[Download RAW message or body]

Am Mon, 07 Feb 2000 schrieb Roberto Alsina:
> On Mon, 7 Feb 2000, Marcos Dione wrote:
> 
> > 
> > 
> > On Mon, 7 Feb 2000, Roberto Alsina wrote:
> > 
> > > On Mon, 7 Feb 2000, Marcos Dione wrote:
> > > 
> > > I don't get it.
> > > 
> > > If the object is a null pointer, obj->free() will still segfault.
> > 
> > 	mmm... I think that the way Dephi does it is a static class
> > member... guessing too much?
> 
> Ok, QObject::free(myobj) would indeed work.
> Although I have no idea on how that method could check that the pointer is
> valid, considering that delete 0 is a perfectly valid noop :-)

IMO we have no real chance to make this in C++. This free feature like it is in
Delphi needs language support. AFAIK free is standard Delphi language and
created automaticly by compiler if not explicitly written in the sources, like
the copy constructor in C++.

> 
>  ("\''/").__..-''"`-. .         Roberto Alsina
>  `9_ 9  )   `-. (    ).`-._.`)  ralsina@unl.edu.ar
>  (_Y_.)' ._   ) `._`.  " -.-'   Centro de Telematica
>   _..`-'_..-_/ /-'_.'           Universidad Nacional del Litoral
> (l)-'' ((i).' ((!.'             Santa Fe - Argentina
>                                 KDE Developer (MFCH)

I love this cat, or whatever it is ;-)

Ciao,
Michael
-- 
koch@kde.org, m_koch@bigfoot.de
http://heaven.riednet.wh.tu-darmstadt.de/~mkoch

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic