[haiku-bugs] Re: [Haiku] #9920: BSynth upgrade

  • From: "jackburton" <trac@xxxxxxxxxxxx>
  • Date: Mon, 22 Sep 2014 05:14:54 -0000

#9920: BSynth upgrade
-----------------------------+-------------------------
   Reporter:  Pete           |      Owner:  korli
       Type:  enhancement    |     Status:  new
   Priority:  normal         |  Milestone:  R1
  Component:  Kits/Midi Kit  |    Version:  R1/alpha4.1
 Resolution:                 |   Keywords:
 Blocked By:                 |   Blocking:
Has a Patch:  1              |   Platform:  All
-----------------------------+-------------------------

Comment (by jackburton):

 Replying to [comment:27 Pete]:
 > Replying to [comment:21 jackburton]:

 > Actually looking at my original code, I don't see a leak...  Maybe I'm
 looking at things wrong, but I only create the fMonitor buffer if it
 doesn't exist. All further calls to PlayBuffer use that.  It then gets
 deleted when BSynth finally goes away.  (I'm not sure if it's possible for
 'size' to vary, but it doesn't matter if it does because any attempt to
 transfer sommething larger just gets clipped; smaller just leaves a hole.
 For the crude purposes of GetAudio, we don't care.)  And deleting and
 creating the buffer each time must slow things down quite a bit.
 >
 You're right, there wasn't a memory leak. But size could vary, and I don't
 know if it does, too.
 Anyway, since your code didn't contain a memory leak, I'll revert to using
 it directly, especially because it doesn't crash :)

 > I think your code is crashing due to a race condition.  GetAudio can get
 invoked just when fMonitor has been deleted.

 If this kind of race condition exists, I guess we should use locking to
 protect these variables.

--
Ticket URL: <https://dev.haiku-os.org/ticket/9920#comment:28>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: