Date:2013-07-19 20:35:45 (4 years 11 months ago)
Author:Paul Cercueil
Commit:b6dfdc6ef5b9dc63e2656e8765daefdc6cd092ba
Message:Stop watching a directory when it has been reported as removed

Files: src/menu.cpp (1 diff)
src/monitor.cpp (1 diff)
src/monitor.h (1 diff)

Change Details

src/menu.cpp
582582            }
583583        }
584584    }
585
586    /* Remove registered monitors */
587    for (vector<Monitor *>::iterator it = monitors.begin();
588                it < monitors.end(); it++) {
589        if ((*it)->getPath().compare(0, path.size(), path) == 0) {
590            delete (*it);
591            monitors.erase(it);
592        }
593    }
585594}
586595#endif
587596#endif
src/monitor.cpp
9393{
9494    pthread_cancel(thd);
9595    pthread_join(thd, NULL);
96    DEBUG("Monitor thread stopped (was watching %s)\n", path.c_str());
9697}
9798#endif
src/monitor.h
1414    virtual ~Monitor();
1515
1616    int run(void);
17    const std::string getPath(void) { return path; }
1718
1819private:
1920    std::string path;

Archive Download the corresponding diff file



interactive