OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: Alex Shevchuk (ashevchukCORILLIAN.COM)
Date: Fri Mar 22 2002 - 10:38:28 CST

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    Yes, my mistake. I checked it at home and I realized
    Data_t is new'ed, not alloc'ed.

    > -----Original Message-----
    > From: Sofus Mortensen [mailto:listLAMBDASOFT.DK]
    > Sent: Friday, March 22, 2002 12:35 AM
    > To: DCOMDISCUSS.MICROSOFT.COM
    > Subject: Re: bug in _bstr_t ????
    >
    >
    > Alex, I believe you're wrong.
    >
    > _bstr_t::Data_t is not stack allocated. It is dynamically
    > allocated and
    > reference counted. It will not be deleted until the last
    > _bstr_t holding
    > on to it, let's go.
    >
    > Something else is wrong here.
    >
    > Best regards,
    > Sofus Mortensen
    >
    > http://www.sofusmortensen.com
    >
    >
    > > -----Original Message-----
    > > From: Distributed COM-Based Code [mailto:DCOMDISCUSS.MICROSOFT.COM]
    > On
    > > Behalf Of Alex Shevchuk
    > > Sent: Thursday, March 21, 2002 8:07 PM
    > > To: DCOMDISCUSS.MICROSOFT.COM
    > > Subject: Re: bug in _bstr_t ????
    > >
    > > In order to understand that the code is fundamentally broken,
    > > take a look at _bstr_t class in comutil.h.
    > > See the difference in implementation between
    > >
    > > _bstr_t& _bstr_t::operator=(const _bstr_t& s)
    > >
    > > and
    > >
    > > _bstr_t& _bstr_t::operator=(const wchar_t* s), for example.
    > >
    > > Because scope of batrval2 is limited by ExtractAddErrInfo,
    > > class Data_t inside batrval2 will be in the stack and all
    > > assignments will have references to that Data_t.
    > > So, on exit from ExtractAddErrInfo we will have reference
    > > in _bstr_t val to something which does not exist anymore.
    > >
    >
    > ----------------------------------------------------------------
    > Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
    > contains important info. Save time, search the archives at
    > http://discuss.microsoft.com/archives/index.html .
    > To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM
    >

    ----------------------------------------------------------------
    Users Guide http://discuss.microsoft.com/archives/mailfaq.asp
    contains important info. Save time, search the archives at
    http://discuss.microsoft.com/archives/index.html .
    To unsubscribe, mailto:DCOM-signoff-requestDISCUSS.MICROSOFT.COM