setMask() API bug

Hello,

I'd like to ask you about Object: setMask() of Korona API.
I'm currently working on to cut images by using setMask() like below:

local mask=graphics.newMask("mask.png")

function imageClip(img,x,y,w,h)
img.clip={}
img.clip.x=x
img.clip.y=y
img.clip.w=w
img.clip.h=h

img:setMask(mask)
img.maskScaleX=(w/504)*(1/img.xScale)
img.maskScaleY=(h/504)*(1/img.yScale)
-- coordinate change
img.maskX=(x-img.x+(w/2))*(1/img.xScale)
img.maskY=(y-img.y+(h/2))*(1/img.yScale)
end

However, if I use this format, it is randomly crashed and stopped on the iPhone and Mac Simulator.

For Android, to create a group in an object cutting by imageClip function and to put that object, it won't randomly work.
It is closed with the massage below in a terminal window in Mac Simulator:

/Applications/CoronaSDK/Corona Terminal: line 9: 7744 Segmentation fault "$path/Corona Simulator.app/Contents/MacOS/Corona Simulator" $*
logout

Also, when using GPS in Android, Runtime:addEventListener( "location", eventlocation ) API, it sometimes happens that function eventlocation(event) is not called.

I'm currently using Mac 657.
Could you please answer two questions listed above?

Thank you for your time.

views:1666 update:2011/12/1 20:56:45
corona forums © 2003-2011