To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=79019
                 Issue #|79019
                 Summary|comphelper: meaningless pGuardArray = 0 in dtor
               Component|utilities
                 Version|OOo 2.2.1
                Platform|All
                     URL|
              OS/Version|All
                  Status|NEW
       Status whiteboard|
                Keywords|
              Resolution|
              Issue type|PATCH
                Priority|P3
            Subcomponent|code
             Assigned to|hro
             Reported by|cmc





------- Additional comments from [EMAIL PROTECTED] Fri Jun 29 13:29:38 +0000 
2007 -------
in source/property/MasterPropertySet.cxx we have something dubious going on...

class AutoOGuardArray
{
    sal_Int32                       nSize;
    std::auto_ptr< vos::OGuard > *  pGuardArray;

public:
    AutoOGuardArray( sal_Int32 nNumElements );
    ~AutoOGuardArray();

    std::auto_ptr< vos::OGuard > &  operator[] ( sal_Int32 i ) { return
pGuardArray[i]; }
};

AutoOGuardArray::AutoOGuardArray( sal_Int32 nNumElements )
{
    nSize       = nNumElements;
    pGuardArray = new std::auto_ptr< vos::OGuard >[ nSize ];
}

AutoOGuardArray::~AutoOGuardArray()
{
    for (sal_Int32 i = 0;  i < nSize;  ++i)
        pGuardArray = 0;    //!! release auto_ptr's and thus the mutexes locks
}

a dynamic array of auto_ptrs is still a dynamic array, it isn't an auto_ptr
itself, setting it to 0 just leaks that array of auto_ptrs. Certainly doesn't do
what the comment indicates it does.

How about the attached patch...

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to