From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ce667ecdc314f22,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-07 11:52:22 PST Path: supernews.google.com!sn-xit-03!supernews.com!news-out.usenetserver.com!news-out-sjo.usenetserver.com!europa.netcrusader.net!205.252.116.205!howland.erols.net!portc.blue.aol.com.MISMATCH!portc03.blue.aol.com!peerfeed.news.psi.net!filter.news.psi.net!reader.dist.news.psi.net!client!not-for-mail Message-ID: <3AA692A8.F1283C27@netscape.net> From: Byron Kauffman X-Mailer: Mozilla 4.7 [en] (WinNT; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Releasing Aliased Variables Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 07 Mar 2001 13:57:28 -0600 NNTP-Posting-Host: 130.210.205.193 X-Trace: client 983994701 130.210.205.193 (Wed, 07 Mar 2001 14:51:41 EST) NNTP-Posting-Date: Wed, 07 Mar 2001 14:51:41 EST Xref: supernews.google.com comp.lang.ada:5506 Date: 2001-03-07T13:57:28-06:00 List-Id: 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.