Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Carbon sleep?



2002-02-28 04.00, bholbert <email@hidden> wrote:

> just for others that might be interested
>
> #include <CoreServices/CoreServices.h>
>
> UInt32 *finalCount;
>
> Delay((5*60),finalCount); //This is a 5 second delay I think since the
> doc said a tick is 1/60 os a second...anyway it seems to work for me.

Hmm... Maybe I'm wrong, but couldn't that crash?
Delay returns the final tickcount in the finalCount parameter. In the code
above, finalCount points to some random memory area, so Delay will write
four bytes into some random place in memory.
I think
UInt32 finalCount;
Delay((5*60),&finalCount);
would be much safer.

Right?


/Jesper
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.