[Qt-interest] Re : Re : Follow-up "QHash::const_iterator not reentrant?"
BOUCARD Olivier
boucard_olivier at yahoo.fr
Mon Aug 22 17:47:18 CEST 2011
Because to make myself clear.
I have also a case, where calling end() and begin() with const_iterator on the same shared object with a different QHash, which actually works!
The only difference its that I cannot set this second QHash from the exterior, onlyconstructors can.
>________________________________
>De : BOUCARD Olivier <boucard_olivier at yahoo.fr>
>À : "qt-interest at qt.nokia.com" <qt-interest at qt.nokia.com>
>Envoyé le : Lundi 22 Août 2011 17h38
>Objet : [Qt-interest] Re : Follow-up "QHash::const_iterator not reentrant?"
>
>
>Thank you. Effectively it works.
>
>
>But sorry, it does not explain why this code crash.
>Or more precisely, why calling a detach at this point cause a failure?
>
>
>Olivier.
>
>
>
>>________________________________
>>De : Andreas Pakulat <apaku at gmx.de>
>>À : qt-interest at qt.nokia.com
>>Envoyé le : Lundi 22 Août 2011 17h11
>>Objet : Re: [Qt-interest] Follow-up "QHash::const_iterator not reentrant?"
>>
>>On 22.08.11 15:54:56, BOUCARD Olivier wrote:
>>> Hi everyone,
>>>
>>> I am coming back to you as I found the same problem on a more critical part of my code.
>>> I join a small piece of code which reproduce the problem.
>>> I really don't know where is the problem, this is probably not a reentrancy problem.
>>
>>You're mixing non-const with const iterators, thats your problem.
>>Replace the begin/end with constBegin/constEnd in receiverworker.cpp and
>>the example works fine.
>>
>>Andreas
>>
>>_______________________________________________
>>Qt-interest mailing list
>>Qt-interest at qt.nokia.com
>>http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>>
>>
>>
>_______________________________________________
>Qt-interest mailing list
>Qt-interest at qt.nokia.com
>http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20110822/230522fb/attachment.html
More information about the Qt-interest-old
mailing list