BMediaRoster: Definitely undertake the MediaRosterUndertaker
* On a more deep analysis i figured out that other than being a bad pratice quitting the BLooper explicitly was cause of more problems, such as the regression after my patches which led to have a zombie media_addon_server after media services restart. This should hopefully place a final stone on the BMediaRoster::Quit() issue as with the previous commit i've removed every attempt to do this in the system. For any application developer listening, this means that quitting the BMediaRoster is highly discouraged, don't do it.
This commit is contained in:
parent
3f5483c79b
commit
40de3cd148
@ -84,28 +84,12 @@ struct RosterNotification {
|
||||
static bool sServerIsUp = false;
|
||||
static List<RosterNotification> sNotificationList;
|
||||
|
||||
// This class is provided to ensure the BMediaRoster is quit.
|
||||
class MediaRosterUndertaker {
|
||||
public:
|
||||
~MediaRosterUndertaker()
|
||||
{
|
||||
if (BMediaRoster::CurrentRoster() != NULL) {
|
||||
BMediaRoster::CurrentRoster()->Lock();
|
||||
BMediaRoster::CurrentRoster()->Quit();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace media
|
||||
} // namespace BPrivate
|
||||
|
||||
using namespace BPrivate::media;
|
||||
|
||||
|
||||
static MediaRosterUndertaker sUndertaker;
|
||||
|
||||
|
||||
BMediaRosterEx::BMediaRosterEx(status_t* _error)
|
||||
:
|
||||
BMediaRoster()
|
||||
@ -134,7 +118,6 @@ BMediaRosterEx::BuildConnections()
|
||||
server_register_app_reply reply;
|
||||
request.team = BPrivate::current_team();
|
||||
request.messenger = BMessenger(NULL, this);
|
||||
|
||||
status_t status = QueryServer(SERVER_REGISTER_APP, &request,
|
||||
sizeof(request), &reply, sizeof(reply));
|
||||
if (status != B_OK)
|
||||
|
Loading…
Reference in New Issue
Block a user