We can't use the be_app looper, since it can be already locked from
another thread (for example, when quitting the app/window), and that would cause a deadlock. Fixes bug #1645. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23995 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -177,14 +177,11 @@ PathHandler::PathHandler(const char* path, uint32 flags, BMessenger target)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
BLooper* looper;
|
BLooper* looper;
|
||||||
if (be_app != NULL) {
|
// TODO: only have a single global looper!
|
||||||
looper = be_app;
|
// TODO: Use BLooper::LooperForThread(find_looper(NULL)) ?
|
||||||
} else {
|
looper = new BLooper("PathMonitor looper");
|
||||||
// TODO: only have a single global looper!
|
looper->Run();
|
||||||
looper = new BLooper("PathMonitor looper");
|
fOwnsLooper = true;
|
||||||
looper->Run();
|
|
||||||
fOwnsLooper = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
looper->Lock();
|
looper->Lock();
|
||||||
looper->AddHandler(this);
|
looper->AddHandler(this);
|
||||||
@@ -492,6 +489,7 @@ PathHandler::MessageReceived(BMessage* message)
|
|||||||
|
|
||||||
if (fOwnsLooper)
|
if (fOwnsLooper)
|
||||||
looper->Quit();
|
looper->Quit();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user