home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11446 < prev    next >
Encoding:
Text File  |  1992-07-23  |  939 b   |  28 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!sun-barr!decwrl!pa.dec.com!brister
  3. From: brister@decwrl.dec.com (James Brister)
  4. Subject: delete this;
  5. Message-ID: <BRISTER.92Jul23172945@sausalito.decwrl.dec.com>
  6. Sender: news@PA.dec.com (News)
  7. Organization: DEC Western Software Lab
  8. Date: 23 Jul 92 17:29:45
  9. Lines: 17
  10.  
  11. Is that legal? Opinion around here is that it's OK as long as it's the last
  12. thing I do in the method (i.e. I don't try to access any data inside the
  13. object). 
  14.  
  15. The situation is that I have a referrence count in an object, and I want to
  16. do obj->decrementRefCount(); and if the ref count drops to zero, then
  17. have the object get deleted (rather than force the function calling
  18. decRefCount to check for this and call delete itself).
  19.  
  20. Possible problems?
  21.  
  22. Thanks
  23.  
  24. James
  25. --
  26. James Brister                                           brister@wsl.pa.dec.com
  27. DEC Western Software Lab., Palo Alto, CA                        decwrl!brister
  28.