[Ace-users] [ace-users] ACE_Refcounted_Auto_Ptr should be improve

Johnny Willemsen jwillemsen at remedy.nl
Sun Dec 16 13:20:12 CST 2007


Hi,

Thanks for the changes. I have incorperated them into my tree and will commit this to the repository

Johnny

> -----Original Message-----
> From: Hu Yi [mailto:huyi.zg at gmail.com]
> Sent: Sunday, December 16, 2007 2:19 PM
> To: Johnny Willemsen
> Subject: Re: ACE_Refcounted_Auto_Ptr should be improve
> 
> hi, johnny
> I have do the work, but I don't known how to submit a patch, see the
> attached file plz.
> 
> 
> 
> ACE VERSION: 5.6.1
> 
>    Localhost and WindowsXP:
> 
>    AREA/CLASS/EXAMPLE AFFECTED:
> 
> class Object;
> typedef ACE_Refcounted_Auto_Ptr<Object, ACE_Null_Mutex> Object_RefPtr;
> 
> void method1(Object_RefPtr obj){}
> void method2(Object_RefPtr obj){}
> 
> Object *obj = new Object;
> method1(obj);
> method2(obj);
> this will be error on memory, (the method1 destroyed obj), but the
> compiler didn't tell me anything.
> 
> NOTICE:
> Object *obj = new Object;
> should change to
> Object_RefPtr obj(new Object);
> 
> 
> I fixed this , and also add supports for operator! , that help me port
> my smart pointer from boost to ACE
> 
> thanks
> 
> HuYi
> 2007.12.15
> 
> 
> 
> On 12/16/07, Johnny Willemsen <jwillemsen at remedy.nl> wrote:
> > Hi,
> >
> > When I add explicit the tests/Refcounted_Auto_Ptr.cpp doesn't compile
> > anymore, can you provide a patch that addresses your concerns but
> also
> > results in no compile errors.
> >
> > Regards,
> >
> >
> > Johnny Willemsen
> > Remedy IT
> > Postbus 101
> > 2650 AC  Berkel en Rodenrijs
> > The Netherlands
> > www.theaceorb.nl / www.remedy.nl
> >
> > *** Integrated compile and test statistics see
> > http://scoreboard.theaceorb.nl ***
> > *** Commercial service and support for ACE/TAO/CIAO             ***
> > *** See http://www.theaceorb.nl/en/support.html                 ***
> >
> >
> >
> > "HuYi" <huyi.zg at gmail.com> wrote in message
> > news:<a7b9f09e-7650-46d1-b60c-
> 1fa83cb2b955 at i12g2000prf.googlegroups.com>...
> > > My application is based on ACE, and I don't like use too much
> third-
> > > libs.
> > > I found that ACE_Refcounted_Auto_Ptr not use the "explicit" keyword
> on
> > > constructor, this made my app unsafe.
> > > I checked the boost smart pointer libs, it use "explicit", and it's
> > > work ok.
> > >
> > > Maybe I made some mistake in my application, what really cause the
> > > error, but I hope the complier can help me to find it. can ACE team
> > > fix this?
> > >
> >
> >



More information about the Ace-users mailing list