[haiku-commits] Re: haiku: hrev53395 - src/kits/game

  • From: Ryan Leavengood <leavengood@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 27 Aug 2019 08:38:30 -0400

On Tue, Aug 27, 2019 at 4:44 AM Axel Dörfler <axeld@xxxxxxxxxxxxxxxx> wrote:


I'm a bit worried about this, or rather, the change that led to this one.
It appears to break binary compatibility. I just updated my system to a
revision that contains this, and my own app "theScheduler" crashes on
start, and the media server on shutdown.

I switched a statically created and destroyed PortPool variable to a
pointer initialized by the BMediaRoster and destroyed by the
BMediaRosterUndertaker. It is private to the media kit and only used
by request_data so this seems surprising to me. FWIW I was inspired by
a change you made a long time ago on some of the other global
variables in the Media Kit.

The bug I was fixing was related to parts of the Media Kit using
request_data during quitting of an app when PortPool had already been
destroyed by the static cleanup code. Another fix might be to find a
way to better control when a static variable is deleted.

I am open to suggestions and I talked to Adrien in IRC about how I
don't like how he had to change the Game Kit like this. But going back
to the old code causes many Media Kit apps to crash on close. What is
unclear is why this seems to be happening now but didn't happen
before.

One thing I have noticed from printing out the usage of the PortPool
is that it is basically used a lot in the beginning, then not at all
until the app quits. So switching to something that is created when
needed might work. But there is still the issue of destroying it.

-- 
Regards,
Ryan

Other related posts: