Crash in KRecentFilesAction related to KURL handling

Andras Mantia amantia at kde.org
Tue Dec 20 19:07:34 GMT 2005


Hi,

 I may regret the day when I implemented the shortname feature in 
KRecentFilesActions...
In KRecentFilesAction::addURL there is a workaround to avoid a crash, 
wheree the manipulation is done on a copy of a KURL. David (Faure) 
corrected my comment to look like this:

     const KURL u = url; // make a copy since d->m_urls.erase( title ) 
could destroy the KURL that "url" references

Unfortunately it doesn't seem to help and now I'm clueless. The code in 
this method looks correct, still it corrupts KURL. Later down in the 
same method there is a line:
    d->m_urls.insert( title, u );

After this line the "url" is corrupted. "url" is passed as "const KURL& 
url", those it is corrupted also in the method where it might be used, 
so the crash can happen anytime after a KRecentFilesAction::addURL call 
where the url argument is used.

Does anyone have a clue what can happen here? I may try valgrind if it 
works on x86_64, but only with addrcheck.

Andras

-- 
Quanta Plus developer - http://quanta.kdewebdev.org
K Desktop Environment - http://www.kde.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20051220/f3246719/attachment.sig>


More information about the kde-core-devel mailing list