Review Request 121817: Fix for crash which was introduced by RR 121480 (use QCollator instead of KStringHandler)

Frank Reininghaus frank78ac at googlemail.com
Sun Jan 4 18:09:14 GMT 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121817/#review73089
-----------------------------------------------------------

Ship it!


This looks like it should fix the crash indeed, thanks!

Something that we might want to keep in mind is to check if there is now more collator-copying than needed. At first sight, it looks like a copy of the collator will be created not only when a new thread is forked, but every time a recursive call is made in kfileitemmodelsortalgorithm.h, right? I'm not sure how expensive creating a new collator is, but it might be worth investigating that (but after this commit is pushed - better fix this crash first and then look at the performance later).

- Frank Reininghaus


On Jan. 3, 2015, 10:22 nachm., Emmanuel Pescosta wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121817/
> -----------------------------------------------------------
> 
> (Updated Jan. 3, 2015, 10:22 nachm.)
> 
> 
> Review request for Dolphin.
> 
> 
> Bugs: 342316
>     http://bugs.kde.org/show_bug.cgi?id=342316
> 
> 
> Repository: kde-baseapps
> 
> 
> Description
> -------
> 
> While porting away from KStringHandler::naturalCompare to QCollator::compare, I had thought that QCollator is an drop-in replacement for KStringHanlder (also regarding to thread safety) - but according to the docs it's reentrant only (sry I missed that), surprisingly sorting with multiple threads never crashed here.
> 
> To fix the issue, we create a new thread local QCollator instance for every thread.
> 
> 
> Diffs
> -----
> 
>   dolphin/src/kitemviews/kfileitemmodel.h df7a5e3 
>   dolphin/src/kitemviews/kfileitemmodel.cpp 1c92a2c 
> 
> Diff: https://git.reviewboard.kde.org/r/121817/diff/
> 
> 
> Testing
> -------
> 
> Kai and Lane tested this patch and they confirmed that the patch fixes the crash for them.
> 
> 
> Thanks,
> 
> Emmanuel Pescosta
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20150104/c1e82c3a/attachment.htm>


More information about the kfm-devel mailing list