[haiku-bugs] [Haiku] #15135: static destruction order problem in mediakit

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Tue, 02 Jul 2019 20:32:50 -0000

#15135: static destruction order problem in mediakit
----------------------------+------------------------------
 Reporter:  pulkomandy      |        Owner:  nobody
     Type:  bug             |       Status:  new
 Priority:  normal          |    Milestone:  Unscheduled
Component:  Kits/Media Kit  |      Version:  R1/Development
 Keywords:                  |   Blocked By:
 Blocking:                  |  Has a Patch:  0
 Platform:  All             |
----------------------------+------------------------------
 I have an app crashing on exit.

 the MediaRosterUndertaker (a static object) is destroyed when my main
 thread is terminating. It signals the media roster looper to terminate.

 When terminating, the media roster notified the Media Kit that it is gone
 (to remove all nodes from the app from the media graph). However, to do
 this it uses the sPortPool, which is also statically allocated. It seems
 the port pool has already been destroyed at this point, so the thread just
 crashes.

 I couldn't find much info about the port pool, my guess it that it's there
 for performance reasons (no need to create a new port everytime we do
 something). Wold it be ok to avoid using it in media roster termination?
 Or is there a way to make the destruction order more safe?

-- 
Ticket URL: <https://dev.haiku-os.org/ticket/15135>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: