Hi,
I’m running into an issue with TextCandy under the latest version of Corona. It has to do with cleaning up during a Composer scene transition. In a nutshell, I have a menu scene in which I have a TC object. In the destroy() method of the scene I’m trying to clean it up with:
textCandy:DeleteText(self.textChallenge);
self.textChallenge = nil;
Now, I’ve confirmed that self.textChallenge is a valid reference by doing a simple print(self.textChallenge) which shows a table ID as expected. I’ve also confirmed that self.textChallenge.name has a value of “FXText” since I saw in the TC code that’s how it determines if it’s a TC object or not. In other words, the object I’m passing to DeleteText() looks to be exactly what’s expected.
However, this DeleteText() call results in this message:
!!! TextFX:DeleteText(): THIS IS NOT A TEXT FX OBJECT.
I’m of course worried that this will produce a memory leak since I’m doing this with a number of scenes that all contain quite a few TC objects. The problem is I want to destroy each scene along the way, I don’t want to maintain anything in memory… If I do configure Composer to not recycle scenes then the issue doesn’t occur, but that’s only because destroy() never gets called.
I’ve also tried doing all of this cleanup in the hide() method instead, and I’ve tried it in both the “will” and “did” phases and the same thing happens in either case.
Does anyone have any idea what I might be doing wrong? I’m really at a loss to explain this and I’ve been banging my head against the wall for a while on this now.
Thanks,
Frank
Frank W. Zammetti
Author of “Pro iOS and Android Apps for Business”
and “Learn Corona SDK Game Development”
and “Practical Palm Pre webOS Projects”
and “Practical Ext JS Projects with Gears”
and “Practical Dojo Projects”
and “Practical DWR 2 Projects”
and “Practical JavaScript, DOM Scripting and Ajax Projects”
and “Practical Ajax Projects with Java Technology”
(ugh, we get the point, you write A LOT!)
Creator of the mobile game Engineer (www.etherient.com)
For all things me, visit www.zammetti.com