[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ cplusplus-bug 582115 ] In file pointer.h,constructor init count
From: |
David Sugar |
Subject: |
Re: [ cplusplus-bug 582115 ] In file pointer.h,constructor init count |
Date: |
Wed, 14 Aug 2002 06:24:47 -0400 |
User-agent: |
KMail/1.4.1 |
It has to be initialized to 1. If we destroy the pointer (ptrDetach), that is
the lone copy of ptrCount as there are no other refs...
On Tuesday 13 August 2002 16:39, Federico Montesino Pouzols wrote:
> Hi, I also think this is a bug. I would expect Pointer<>
> to behave like it does when ptrCounter is initialized to 1.
>
> However, there are many interpretations of this kind of
> classes. Could you confirm if this is a bug, David?
>
>
> -----------------------------------------------------------
> Package commoncpp2-0.99.6.tar.gz
>
> In file pointer.h, the constructor doesn't init ptrcount :
>
> explicit Pointer(T* ptr = NULL) : ptrObject(ptr)
> {
> ptrCount = new unsigned;
> }
>
>
> I think it should be :
>
> explicit Pointer(T* ptr = NULL) : ptrObject(ptr)
> {
> ptrCount = new unsigned;
> *ptrCount = 1;
> }
>
>
>
>
> _______________________________________________
> Bug-commoncpp mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-commoncpp