home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 17906 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.9 KB  |  55 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!psinntp!uu0465!andrew
  3. From: andrew@tagsys.com (Andrew Gideon)
  4. Subject: USL C++ Standard Components - A bug?
  5. Message-ID: <1992Dec13.195120.4368@tagsys.com>
  6. Organization: TAG Systems inc.
  7. Date: Sun, 13 Dec 1992 19:51:20 GMT
  8. Lines: 45
  9.  
  10.  
  11. I have just started working with the USL/C++ Standard
  12. Components for a new client.  Already, I may have found
  13. a very serious problem.  I hope that I'm wrong.
  14.  
  15. I have been working with the Rogue Wave tools.h++ product for 
  16. quite a while.  One of the first things that I did was
  17. construct deep collections from the RW shallow collections.
  18. It was nice to see that USL had already thought of this
  19. (USL calls deep collections "object collections" and shallow
  20. collections "pointer collections" - some people still publish
  21. implementation {8^).
  22.  
  23. But in my first set of experiments, I immediately noticed
  24. that something was wrong with the deep sets in USL.  
  25.  
  26. When insert()ing objects into a deep set, the copy
  27. constructor is used to create new instances.  The object
  28. passed in the insert() method is still owned by the caller
  29. of insert() - the new copy is held by the set.
  30.  
  31. But when a deep set is destructed, the contained objects are 
  32. NOT destructed.  Further, objects that are remove()ed are also 
  33. not destructed.
  34.  
  35. I could find no way (w/o unsafe casts) to get around this.  
  36. (And even with unsafe casts, I doubt that it would work)
  37.  
  38. This seems like a memory leak.  Am I missing something?
  39. Help, please?
  40.  
  41.     Andrew Gideon
  42.  
  43.  
  44.  
  45.  
  46. === 
  47.  -----------------------------------------------------------
  48. | Andrew Gideon              |                              |
  49. | Consultant                 |                              |
  50. |                            |   TAG Systems inc.           |
  51. | Tel: (201) 890-7189        |   D2-181 Long Hill Road      |
  52. | Fax: (201) 890-1581        |   Little Falls, N.J., 07424  |
  53. | andrew@tagsys.com          |                              |
  54.  -----------------------------------------------------------
  55.