mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-29 17:17:31 +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
|
||||||
#endif
|
#endif
|
||||||
|
@ -93,5 +93,6 @@ Monitor::~Monitor(void)
|
|||||||
{
|
{
|
||||||
pthread_cancel(thd);
|
pthread_cancel(thd);
|
||||||
pthread_join(thd, NULL);
|
pthread_join(thd, NULL);
|
||||||
|
DEBUG("Monitor thread stopped (was watching %s)\n", path.c_str());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -14,6 +14,7 @@ public:
|
|||||||
virtual ~Monitor();
|
virtual ~Monitor();
|
||||||
|
|
||||||
int run(void);
|
int run(void);
|
||||||
|
const std::string getPath(void) { return path; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string path;
|
std::string path;
|
||||||
|
Loading…
Reference in New Issue
Block a user