[Libreoffice] [PATCH] Fix for dialog Manage Breakpoints crash

Niklas Johansson sleeping.pillow at gmail.com
Tue Nov 29 00:50:26 PST 2011


>> In worst case it makes the program crash. This fix, stores
>> the values. I'm not that experienced with C++ so could someone have
>> a second look at this there might very well be a "cleaner" way of
>> writing it.
> Good find!
>
> I think I would do it slightly different, the patch fixes the symptom
> correctly by allocating new objects, but the underlying cause to me
> seems that the original intention was to transfer the pointers (hence
> the method's name) but that somehow got mangled with the transition from
> old List to ::std::vector
>
>
>> --- a/basctl/source/basicide/bastypes.cxx
>> +++ b/basctl/source/basicide/bastypes.cxx
>> @@ -288,7 +288,7 @@ void BreakPointList::transfer(BreakPointList&  rList)
>>   {
>>       reset();
>>       for (size_t i = 0; i<  rList.size(); ++i)
>> -        maBreakPoints.push_back( rList.at( i ) );
>> +        maBreakPoints.push_back( new BreakPoint(*rList.at( i )) );
>>       rList.reset();
>>   }
> Instead of creating copies I'd do
>
> -      rList.reset();
> +      rList.clear();
>
> Please check if that fixes the problem.
>
>    Eike

That fixes the problem, and definitely looks like a cleaner solution. Do 
you create the patch or should I create a new one?

I created and attached a patch for the pass count.
Description:
"Example: When entering pass count 2 it is expected that the breakpoint 
is passed two times before breaking not to break the second time."

Thanks
Niklas Johansson

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-Fixes-pass-count-in-Manage-Breakpoints.patch
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20111129/0df25bda/attachment.ksh>


More information about the LibreOffice mailing list