You are correct, so the check is not necessary, but I think it would still be good to use the macro because double-deleting a pointer is still not ok. Using DELETEP(ptr) twice is fine. Then again, deleting from two independent (unrelated?) places usually means there's an ownership problem.
----- Original Message ----- From: "Tomas Frydrych" <[EMAIL PROTECTED]> To: "Paul Rohr" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Thursday, May 30, 2002 11:23 AM Subject: Re: DELETEP, FREEP, and friends > > > In short, the whole reason we created those macros was to ensure that > > all delete, free, etc. calls did all of the nice null-sanity work > > you'd usually want. Thus instead of typing the risky: > > > > delete m_pHeaderSL; > > > > Correct me if I am mistaken, but the c++ operator is designed to > handle NULLs, so it is not really necessary to this kind of a check; > its a different story with free though, isn't it? > > > motto -- a little macro goes a long, long way > a little macro can also obscure code an awfull "long" :-). > > Tomas >
