1 May
2003
1 May
'03
11:57 a.m.
Dear John, I have done a mistake in the answer to your following assertion:
Note also, that you're supposed to initialized shared_ptr<T> with a *dynamically* allocated T (use new), because it will call 'delete' on the ptr when the last reference disappears. So you are wrong to initialize it with the address of a stack variable.
By the destructor of the object, I meant some mechanism for "realeasing" the contained object whithin boost::shared_ptr<>. Silly! Not? So the true answer is not to forget to call the reset() member function for every shared_ptr<>, before the end of it's scope. Thanks, --Hossein __________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. http://search.yahoo.com