Don't choke in BPathMonitor::StopWatch(...) if the client never called
StartWatching() before and the BPathMonitor stuff is therefor not initialized. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26792 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -815,6 +815,9 @@ BPathMonitor::StartWatching(const char* path, uint32 flags, BMessenger target)
|
|||||||
/*static*/ status_t
|
/*static*/ status_t
|
||||||
BPathMonitor::StopWatching(const char* path, BMessenger target)
|
BPathMonitor::StopWatching(const char* path, BMessenger target)
|
||||||
{
|
{
|
||||||
|
if (sLocker == NULL)
|
||||||
|
return B_NO_INIT;
|
||||||
|
|
||||||
BAutolock _(sLocker);
|
BAutolock _(sLocker);
|
||||||
|
|
||||||
WatcherMap::iterator iterator = sWatchers.find(target);
|
WatcherMap::iterator iterator = sWatchers.find(target);
|
||||||
@@ -845,6 +848,9 @@ BPathMonitor::StopWatching(const char* path, BMessenger target)
|
|||||||
/*static*/ status_t
|
/*static*/ status_t
|
||||||
BPathMonitor::StopWatching(BMessenger target)
|
BPathMonitor::StopWatching(BMessenger target)
|
||||||
{
|
{
|
||||||
|
if (sLocker == NULL)
|
||||||
|
return B_NO_INIT;
|
||||||
|
|
||||||
BAutolock _(sLocker);
|
BAutolock _(sLocker);
|
||||||
|
|
||||||
WatcherMap::iterator iterator = sWatchers.find(target);
|
WatcherMap::iterator iterator = sWatchers.find(target);
|
||||||
|
|||||||
Reference in New Issue
Block a user