The problem is resolved when the allocation is moved to the start of dekmain(),
the globals are accessed through a pointer to one instance of the typedef'd
struct, which is declared at the start of deskmain(), and assigned to a locked
chunk until the end of deskmain().
desk accessories 'DAcc' allow no globals, so the eventloop is slightly
different from the norm :
// ••••••••••••••••••••••••••
// Eventloop
void
Eventloop(Global *GLB)
{
Err err;
EventType event;
Boolean done=false;
do{
EvtGetEvent(&event, 0); // evtWaitForever
if (SysHandleEvent(&event)) continue;
if (MenuHandleEvent(NULL, &event, &err)) continue;
done=DeskHandler(&event, GLB);
} while (!done);
return;
}
allowing for the four byte pointer to the stuct declared in deskmain() to be
passed from function to function.
There have been no problems using this method.
When debugging the problem, the resets where occurring when the application
quit, and not when the allocations where being freed.
????
many thanks
regards Darren
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/