Skip to content

Commit

Permalink
BMediaRoster: Definitely undertake the MediaRosterUndertaker
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
Numerio committed Jul 27, 2015
1 parent 3f5483c commit 40de3cd
Showing 1 changed file with 0 additions and 17 deletions.
17 changes: 0 additions & 17 deletions src/kits/media/MediaRoster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 40de3cd

Please sign in to comment.