comp.lang.ada
 help / color / mirror / Atom feed
* Releasing Aliased Variables
@ 2001-03-07 19:57 Byron Kauffman
  2001-03-07 20:44 ` tmoran
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Byron Kauffman @ 2001-03-07 19:57 UTC (permalink / 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.




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2001-12-27 12:26 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-07 19:57 Releasing Aliased Variables Byron Kauffman
2001-03-07 20:44 ` 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

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