[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-core-devel
Subject: Re: KDirWatch still causes crashes
From: Josef Weidendorfer <Josef.Weidendorfer () gmx ! de>
Date: 2002-03-27 8:35:14
[Download RAW message or body]
On Tuesday 26 March 2002 10:35, Michael Brade wrote:
...
> Ahh, I see. Open Konqy (will be /home/michael for me), go to tmp, go to
> test, go to folder (so all the three are watched). Open a konsole, go to
> tmp and type "mv test new" -> crash. Carsten mentioned to recompile
> something but it didn't help yet (I recompiled kdelibs/kio after the last
> kdirwatch commit and konqy).
I think I found the problem. The handling of FAM events for already deleted
dirs was wrong. Can you check the following patch?
Cheers,
Josef
diff -u -3 -p -r1.71 kdirwatch.cpp
--- kdirwatch.cpp 2002/03/25 00:55:38 1.71
+++ kdirwatch.cpp 2002/03/27 08:30:39
@@ -958,8 +958,17 @@ void KDirWatchPrivate::checkFAMEvent(FAM
if (strncmp(fe->filename, ".xsession-errors", 16) == 0) return;
}
- Entry* e = static_cast<Entry*>(fe->userdata);
+ Entry* e = 0;
+ EntryMap::Iterator it = m_mapEntries.begin();
+ for( ; it != m_mapEntries.end(); ++it )
+ if (FAMREQUEST_GETREQNUM(&( (*it).fr )) ==
+ FAMREQUEST_GETREQNUM(&(fe->fr)) ) {
+ e = &(*it);
+ break;
+ }
+ // Entry* e = static_cast<Entry*>(fe->userdata);
+
kdDebug(7001) << "Processing FAM event ("
<< ((fe->code == FAMChanged) ? "FAMChanged" :
(fe->code == FAMDeleted) ? "FAMDeleted" :
@@ -971,7 +980,7 @@ void KDirWatchPrivate::checkFAMEvent(FAM
(fe->code == FAMExists) ? "FAMExists" :
(fe->code == FAMEndExist) ? "FAMEndExist" : "Unknown
Code")
<< ", " << fe->filename
- << ", Req " << FAMREQUEST_GETREQNUM(&(e->fr))
+ << ", Req " << FAMREQUEST_GETREQNUM(&(fe->fr))
<< ")" << endl;
if (!e) {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic