home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!news.centerline.com!matt
- From: matt@centerline.com (Matt Landau)
- Newsgroups: comp.lang.c++
- Subject: Re: Result of delete operator applied to null pointer?
- Date: 22 Jan 1993 17:33:35 GMT
- Organization: CenterLine Software, Inc.
- Lines: 14
- Message-ID: <1jpb5fINN662@armory.centerline.com>
- References: <1993Jan22.145654.10001@bradford.ac.uk>
- NNTP-Posting-Host: 140.239.1.32
-
- In <1993Jan22.145654.10001@bradford.ac.uk> T.D.G.Sandford@bradford.ac.uk (TDG SANDFORD) writes:
-
- >Is the effect of applying the delete operator to a null pointer defined?
-
- Yes, the effect is defined. Deleting a null pointer is supposed to
- be safe (ARM, section 5.3.4).
-
- Note that there is a bug in USL cfront 3.0.1 that causes "delete[] p"
- to crash if p is NULL and p's destructor is virtual. For this reason,
- you might want to check for null pointers anyway, at least when using
- delete[].
- --
- Matt Landau Waiting for a flash of enlightenment
- matt@centerline.com in all this blood and thunder
-