mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 18:23:08 +02:00
Stop watching a directory when it has been reported as removed
This commit is contained in:
parent
ebce540dfc
commit
b6dfdc6ef5
@ -582,6 +582,15 @@ void Menu::removePackageLink(std::string path)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Remove registered monitors */
|
||||
for (vector<Monitor *>::iterator it = monitors.begin();
|
||||
it < monitors.end(); it++) {
|
||||
if ((*it)->getPath().compare(0, path.size(), path) == 0) {
|
||||
delete (*it);
|
||||
monitors.erase(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@ -93,5 +93,6 @@ Monitor::~Monitor(void)
|
||||
{
|
||||
pthread_cancel(thd);
|
||||
pthread_join(thd, NULL);
|
||||
DEBUG("Monitor thread stopped (was watching %s)\n", path.c_str());
|
||||
}
|
||||
#endif
|
||||
|
@ -14,6 +14,7 @@ public:
|
||||
virtual ~Monitor();
|
||||
|
||||
int run(void);
|
||||
const std::string getPath(void) { return path; }
|
||||
|
||||
private:
|
||||
std::string path;
|
||||
|
Loading…
Reference in New Issue
Block a user