[haiku-development] Make BApplication to quit the BMediaRoster

  • From: Dario Casalinuovo <b.vitruvio@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 23 Sep 2015 15:34:35 +0200

Hi,
I just want to hear if there is some concern against locking the
BMediaRoster to refuse to run if a BApplication isn't present (i.e. via a
debugger() call). The BeBook states that we should have a valid
BApplication, but it's not required to Run(), this is not the case of the
actual haiku implementation however which just doesn't check this.

I'll go with the potential advantages/problems we may face out :

* We define one time for ever when and where the BMediaRoster will be quit.
* If the node use linked BBitmaps, it will crash if it release the objects
after the link with the app server has been destroyed (could potentially
happen in MediaPlayer).
* We will not have anymore apps that call wait_for_thread because there's
this danger.
* A BMediaNode may want to use translators too.
* It's not that hard to fix current apps not doing this by just adding a
"BApplication app;" before to create the BMediaRoster.

Now, my plan is to just have the BApplication destructor to handle it. The
plan is to add something like this :

https://gist.github.com/Barrett17/436612bdb3eff6b35956

I've not found an easier way to do it. I would have done it using
BMessaging but since the app doesn't necessarily Run() this is not doable.

--
Best Regards,
Dario

Other related posts:

  • » [haiku-development] Make BApplication to quit the BMediaRoster - Dario Casalinuovo