I’ve built a test case that I thought replicated the code structure and execution sequence, and its not crashing so there must be something else in the real code that’s creating the problem…I’ll try again tomorrow
Any news on this? I’m sorry I’m pressing this but I have two updates and one release waiting in line. I can’t go to older version because there are other issues. G1 would be an option but I have already converted to G2 and don’t wish to go back.
Should I open a new bug case for this?
Polygonblog: use my workaround and you’llbe ok. It’s described earlier.
Do you mean defining the transition as a variable instead of an object property? I tried it, but it doesn’t make any difference. Crashes anyway.
polygonblog: well… you had to umplement it in wrong way. We have hundreds of transitions and removing this workaround makes our games crash all the time because of onComplete firing twice.
local t local function onCompleteFnc(target) if t then transition.cancel(t) t = nil end -- do something end t = transition.to(obj, {x = whatever, onComplete = onCompleteFnc} )
Tested hundreds of times every day - works like a charm.
It would be great if you showed me how to fix my test case with the workaround. It’s a simple code, you can try it yourself.
Glad to see this is getting more attention.
@krystian6 Did you open a bug case for this? I’d be happy to do it, but I don’t know if this has already been reported. It’s getting confusing;)
@Rob Miracle Did you find a bug case for this?
@joe528 Thanks joe I really appreciate you taking the time to look into this.
@alexf Any luck with my test case?
@polygonblog - please open up a new case
Thanks
P.s.
Right now 6 different project use the workaround I pasted above, all of them work fine. Without it - within a minute or two all of the games crash.
I only found one bug report in the system and it was closed way back in build 1090 as having been fixed (early in 2013). If you have a reproducable case, please file it, complete with config.lua, build.settings and any needed support files (graphics, etc.). When you get the acknowledgement email post the case # back here so we can easily find it.
Rob
I just filed the bug report (Case 33772) with a simple test case.
I guess they want you to use local variable instead of table variable to hold the transitions:
local function CreateBubble() local t1 local t2 local function FloatRight(\_object) local function FloatLeft() t1 = transition.to(\_object, {time=4000, delta=true, x=\_object.contentWidth\*(-1), onComplete=FloatRight}) end t1 = transition.to(\_object, {time=4000, delta=true, x=\_object.contentWidth, onComplete=FloatLeft}) end local function FloatUp (\_object) local function RemoveMe() if t1 ~= nil then transition.cancel(t1) t1 = nil end if t2 ~= nil then transition.cancel(t2) t2 = nil end display.remove(\_object) \_object = nil end t2 = transition.to(\_object, {time = math.random(2500,5000), y = -100, onComplete = RemoveMe}) end local bubble = display.newCircle(math.random(1,1024),810,math.random(4,40)) FloatRight(bubble) FloatUp(bubble) end timer.performWithDelay(11,CreateBubble,0)
However, please note, after testing the code above, it still crashes.
Therefore, your problem is not just about “onComplete firing twice” (or the workaround above is not totally correct, any one can help?)
The problem is still possibly lying in the race condition I told you in another thread.
I’m having problems with crashing (on device only–both simulators are fine) when my onComplete calls a function that uses timer.xxxDelay() to spawn a new transition. The full description is here…does this seem related to the same issues??
Can someone provide me with a bug number for this please?
Dewey, I don’t know if this is related or not.
Since I don’t have any piece of code other then my games, that can simulate this behaviour, I cannot create a case and attach a proper bug report to them.
could you please create a case for this with your samples?
just saw this in my logs…dont know if its related or not but I’m definitely getting a memory leak:
Jun 3 21:57:48 dgiphone aggregated[70] <Warning>: notify name “com.apple.powerlog.BasebandHasCDRXCapability” has been registered 12580 times - this may be a leak
To summarize the workaround described in this thread, I believe the recommendation is to transition.cancel(theTween) from within the onComplete listener. Do I have that correct?
I have implemented this suggestion and my app still crashes on the device, but runs fine in the Apple iOS simulator.
I guess that means the problem I’m having is different from the one described in this thread…Alex or Rob, have either of you guys got any advice for other things I might try??
Thx
Dewey
dgaedcke: A test case would be great. I tried something with the code you posted on the detail thread and it does not replicate.
Thanks,
alex