orbs[0].orbH=DmGetResource(bitmapRsc,OrbYellow);
orbs[0].orbP=MemHandleLock(orbs[0].orbH);
I had assumed that
orbH is MemHandle
and
orbP a BitmapPtr
Now in my program I use
MemPtrUnlock(orbP);
DmReleaseResource( orbH );
and it works fine - no memory leak or any problem at all
I had replace the "MemPtrUnlock(orbP);"
with
MemHandleUnlock(orbH);
DmReleaseResource(orbH);
and stills works ok
The MemPtrUnlock on BitmapPtr was taken
from "static void DrawBackground (void)" from Gungnir.c as a game sample code.
(Similarly in other situations in the sdk, also notice that no DmNewHandle was
previously used)
I guess you will comment on this and you make me choose as well.
Thank you all, that was interesting.
> i guess it should be
> for(i=0;i<6;i++)
> {
> MemHandleUnlock(orbs[i].orbH);
> DmReleaseResource(orbs[i].orbH);
> }
important part was not change to MemPtrunlock, but change in for(;;) - 6
resources were got and locked and only 5 of them unlocked and released
Dmitry Grinberg wrote:
> that would fatal alert, codemaker :-P
> read the sdk or reread your code
>
> On 12/8/08, codemaker <[EMAIL PROTECTED]> wrote:
>> for(i=0;i<=5;i++)
>> {
>> MemHandleUnlock(orbs[i].orbH);
>> DmReleaseResource(orbs[i].orbH);
>> }
>>
>> Weirdly, the resources are not closed.
>>
>> Anyone have any ideas why?
>>
>> Yes
>>
>> for(i=0;i<6;i++)
>> {
>> MemPtrUnlock(orbs[i].orbH);
>> DmReleaseResource(orbs[i].orbH);
>> }
>>
>>
>>
>> --
>>
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/