If a filter was added to a handler which belonged to a looper, the filter's looper was never initialized. BHandler::SetLooper() now also sets the looper for every filter (moved from BLooper::AddHandler)
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13426 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -412,6 +412,9 @@ BHandler::AddFilter(BMessageFilter *filter)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (fLooper != NULL)
|
||||||
|
filter->SetLooper(fLooper);
|
||||||
|
|
||||||
if (!fFilters)
|
if (!fFilters)
|
||||||
fFilters = new BList;
|
fFilters = new BList;
|
||||||
|
|
||||||
@@ -775,9 +778,14 @@ BHandler::operator=(const BHandler &)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BHandler::SetLooper(BLooper *loop)
|
BHandler::SetLooper(BLooper *looper)
|
||||||
{
|
{
|
||||||
fLooper = loop;
|
fLooper = looper;
|
||||||
|
|
||||||
|
if (fFilters) {
|
||||||
|
for (int32 i = 0; i < fFilters->CountItems(); i++)
|
||||||
|
static_cast<BMessageFilter *>(fFilters->ItemAtFast(i))->SetLooper(looper);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -378,13 +378,6 @@ BLooper::AddHandler(BHandler* handler)
|
|||||||
handler->SetLooper(this);
|
handler->SetLooper(this);
|
||||||
if (handler != this) // avoid a cycle
|
if (handler != this) // avoid a cycle
|
||||||
handler->SetNextHandler(this);
|
handler->SetNextHandler(this);
|
||||||
|
|
||||||
BList* filters = handler->FilterList();
|
|
||||||
if (filters) {
|
|
||||||
for (int32 i = 0; i < filters->CountItems(); ++i) {
|
|
||||||
((BMessageFilter*)filters->ItemAt(i))->SetLooper(this);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user