The BTranslatorRoster now locks the looper before it adds/removes it.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17281 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-04-30 18:18:06 +00:00
parent 573c4336a3
commit 29dfc8d391

View File

@ -119,8 +119,10 @@ BTranslatorRoster::Private::Private()
fLazyScanning(true)
{
// we're sneaking us into the BApplication
if (be_app != NULL)
if (be_app != NULL && be_app->Lock()) {
be_app->AddHandler(this);
be_app->Unlock();
}
}
@ -128,8 +130,11 @@ BTranslatorRoster::Private::~Private()
{
stop_watching(this);
if (Looper())
if (Looper() && LockLooper()) {
BLooper* looper = Looper();
Looper()->RemoveHandler(this);
looper->Unlock();
}
// Release all translators, so that they can delete themselves