comp.lang.ada
 help / color / mirror / Atom feed
From: Byron Kauffman <byronbkauffman@netscape.net>
Subject: Releasing Aliased Variables
Date: Wed, 07 Mar 2001 13:57:28 -0600
Date: 2001-03-07T13:57:28-06:00	[thread overview]
Message-ID: <3AA692A8.F1283C27@netscape.net> (raw)

I'm having a problem understanding what defining a variable as aliased
does. Is there a problem with releasing an aliased pointer? Can or
should you even alias a pointer?

I'm using  DirectSound on NT using WinAPI bindings provided by Aonix to
play sounds with my application. To make a long story short, the
procedure you follow is to create a directsound object, create a primary
buffer, and create secondary buffers with all your sounds. Then, when
you're about to shut down the app, you call WinAPI release methods to
release the secondary buffers, the primary buffer, and the directsound
object, in that order. If anything happens to screw up the shutdown and
the objects aren't released, it's only a matter of time before you have
to reboot to reclaim the memory.

I'm declaring all of the directsound objects as aliased, which solved a
problem I was having creating the objects ( it looked like some very
large buffers were being created on the stack). What's happening now is
that the release procedure is bombing down in the Windows code, so
control never returns.




             reply	other threads:[~2001-03-07 19:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-07 19:57 Byron Kauffman [this message]
2001-03-07 20:44 ` Releasing Aliased Variables tmoran
2001-03-07 21:12 ` Robert A Duff
2001-03-08 13:24   ` Florian Weimer
2001-03-08 14:37     ` Pat Rogers
2001-12-27 12:26       ` Florian Weimer
2001-03-08 14:52     ` Tucker Taft
2001-03-08 16:57     ` Robert A Duff
2001-03-09 15:08       ` Using COM Interfaces (was: Releasing Aliased Variables) Byron Kauffman
2001-03-09 17:01         ` Robert A Duff
2001-03-09 21:08         ` tmoran
2001-03-12 18:45     ` Releasing Aliased Variables Richard Kenner
2001-03-07 21:31 ` Florian Weimer
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox