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