[openbeos-midi] Re: BMidiEndPoint

  • From: "Matthijs Hollemans" <matthijs@xxxxxxxxxxxxxxxxxxx>
  • To: <openbeos-midi@xxxxxxxxxxxxx>
  • Date: Thu, 10 Oct 2002 12:50:42 +0100

Hi Jerome,

> Can you explain me what must do BMidiEndPoint::Acquire() and
> BMidiEndPoint::Release()

From the Be Newsletter Volume 4 Issue 3 (one of the few places where
Midi Kit 2is documented):

"The final thing I want to note about the Midi Kit is the
reference counting scheme. Each MIDI endpoint has a
reference count associated with it, so that the bookkeeping
associated with the endpoints is correct. When you construct
an endpoint, it starts with a count of 1. Once the count
hits 0, the endpoint will be deleted. This means that, to
delete an endpoint, you don't call the delete operator
directly; instead, you call BMidiEndpoint::Release(). To
balance this call, there's also a BMidiEndpoint::Acquire(),
in case you have two disparate parts of your application
working with the endpoint, and you don't want to have to
keep track of who needs to Release() the endpoint."

Matthijs Hollemans
All Your Software

Other related posts: