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

List:       kde-devel
Subject:    Re: free instead of destructor
From:       Malte Starostik <starosti () zedat ! fu-berlin ! de>
Date:       2000-02-07 18:38:46
[Download RAW message or body]

Marcos Dione wrote:

>         inteligent? delete ain't "inteligent". try to delete a
> non-allocated object and you'll finish with a SIGSEGV.

If you define non-allocated as a NULL pointer, what I interpreted your sentence
"destroys the object if and only if the object is allocated (is not a null
pointer)"
It won't segfault. A delete myobj with myobj == NULL will do just nothing. If
it's an invalid non-NULL pointer, your lost with Free either.
-Malte


--
A train station is a station where trains stop -
but what the hell is a workstation

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

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