[futurebasic] Re: [FB] C API Conversion

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2005 : Group Archive : Group : All Groups

From: Alain Pastor <apastor@...>
Date: Thu, 17 Nov 2005 05:00:14 +0100
russp@... a écrit :
> Tonight's update:
> 
> I didn't realize that USR AppleScriptLoadAndRun does exactly what I need
> (Thanks Alain).  Ken,  I couldn't pass up on a simple solution although I may
> still have to give your suggestion about coersion a try.
> 
> Here's the latest.  AppleScriptLoadAndRun from a resource is a little more
> than twice as fast as USR APPLESCRIPTRUN.  That's good!  What's bad is it
> crashes my program after calling it about 20 times.  What's more after the
> crash, I notice the clipboard doesn;t work right between applications
> (Scary).  
> 
> Is it possible there's a problem in the Include files where the USRs live?  I
> wonder if there's a dangling handle or something although I couldn;t find
> anything obvious.
> 

Russ,

I've run your test and I got the same trouble as you do. The prog 
crashed after calling AppleScriptLoadAndRun 14 times exactly.

The bug occurs when that routine in executed, that means that your own 
prog is not at fault. I have tried to secure the function to prevent 
possible memory leaks, but that didn't solve the problem at all. Anyway, 
I would be surprised if it were a memory leak causing the trouble. In 
fact, I get the following report:

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_INVALID_ADDRESS (0x0001) at 0xdb84be1e

At the moment, I don't comprehend why the routine works alright 13 times 
in row and fails suddenly. It is possible also that the bug lies in the 
AppleScript API. Like I have stated earlier, based on my personal 
experience, I'm somehow suspicious about that API. I hope now that 
someone will have a mind to rewrite the FB routine.

Alain