home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!psinntp!uu0465!andrew
- From: andrew@tagsys.com (Andrew Gideon)
- Subject: USL C++ Standard Components - A bug?
- Message-ID: <1992Dec13.195120.4368@tagsys.com>
- Organization: TAG Systems inc.
- Date: Sun, 13 Dec 1992 19:51:20 GMT
- Lines: 45
-
-
- I have just started working with the USL/C++ Standard
- Components for a new client. Already, I may have found
- a very serious problem. I hope that I'm wrong.
-
- I have been working with the Rogue Wave tools.h++ product for
- quite a while. One of the first things that I did was
- construct deep collections from the RW shallow collections.
- It was nice to see that USL had already thought of this
- (USL calls deep collections "object collections" and shallow
- collections "pointer collections" - some people still publish
- implementation {8^).
-
- But in my first set of experiments, I immediately noticed
- that something was wrong with the deep sets in USL.
-
- When insert()ing objects into a deep set, the copy
- constructor is used to create new instances. The object
- passed in the insert() method is still owned by the caller
- of insert() - the new copy is held by the set.
-
- But when a deep set is destructed, the contained objects are
- NOT destructed. Further, objects that are remove()ed are also
- not destructed.
-
- I could find no way (w/o unsafe casts) to get around this.
- (And even with unsafe casts, I doubt that it would work)
-
- This seems like a memory leak. Am I missing something?
- Help, please?
-
- Andrew Gideon
-
-
-
-
- ===
- -----------------------------------------------------------
- | Andrew Gideon | |
- | Consultant | |
- | | TAG Systems inc. |
- | Tel: (201) 890-7189 | D2-181 Long Hill Road |
- | Fax: (201) 890-1581 | Little Falls, N.J., 07424 |
- | andrew@tagsys.com | |
- -----------------------------------------------------------
-