Remove all objects

Sorry Tom, but I’m not sure if you understand what happened in this thread:

* none of us were aware that Ansca had “fixed” this recursive removeSelf bug

* we all see memory leaks, and we have no way to judge which ones impede performance on the device

* your public bug database has not been updated for 5 weeks and is known to be completely out of date with what you’re using internally

* we have no access to the bug database that you’re using internally… even though Carlos has promised this in the past

* the bug submission process is completely broken and the resolution is not transparent

* documentation is abysmally out of date - no indication what so ever what this removeSelf really does

* we all have spent/wasted loads of time trying to find work-arounds for bugs that supposedly have been fixed - this is not the first one

* we do not mind (help you) fixing new bugs, but I personally hate fixing known ones…

Please, please… Ansca allow us to help you by improving your communication about bugs and available resolutions.

… and maybe stop coding new features until you fixed that issue…

-FrankS.
[import]uid: 8093 topic_id: 7489 reply_id: 27785[/import]

@FrankS,

I never said this Group bug was fixed. I verified the problem and said the work-around is removing the group’s children before removing the group.

About submitting a bug, you can do that with the “Report a Bug” link at the top of this page (when you are logged in).

The bug data base we use internally has been made available at: http://bugs.anscamobile.com
You need to create an account to view the information. We also post the bug fixes (and the database number) on the Daily Builds page (if you are a Corona subscriber).

As far as documentation, we are trying to update/correct the information. The most up-to-date information is on the API reference pages. You can add comments there if you feel something is missing or incorrect.

Based on this “group” bug, I updated a few of the API pages indicating the work-around to avoid the Lua memory leak. [import]uid: 7559 topic_id: 7489 reply_id: 27789[/import]

“… and maybe stop coding new features until you fixed that issue…”
Absolutely YES, Corona full of features that allow to make good application, but also there are nasty bugs, that prevent from shipping, for example, our game (which crashed on Device and we could not handle this for about a month).

FrankS, thanks for point out all these problems! [import]uid: 9058 topic_id: 7489 reply_id: 27792[/import]

Thanks very much for the http://bugs.anscamobile.com information.

I’ve been a paid subscribed since September, and follow the forums and doc pages almost every day, and I wasn’t aware of this… maybe an updated doc page and more obvious links to this could probably help many more naive subscribers like me :wink:

Unless there are already obvious links to this and then I sincerely apologize…

-FrankS.
[import]uid: 8093 topic_id: 7489 reply_id: 27795[/import]

I have some good news. The group removal memory leak bug has been fixed and is available starting with daily build #318. Previously, removing a group with children (other display objects) would free the texture memory used by the children but still left references to the Lua variables. This caused the memory leak observed when repeatably creating and removing groups without first removing the children from the group.

It should now be safe to remove a group without having to remove the children within the group first.

Also, based on the underlining “removeSelf” code, any object listeners associated with the objects in the group, should be removed by the Lua garbage collection since the objects themselves are removed. This means there should be no need to object:removeEventListener for objects in the group. Any global event listeners (Runtime:AddEventListener) will still need to be removed manually.

Please test this yourselves and let us know if you see any problems.

Thanks everyone for your help and input.
-Tom [import]uid: 7559 topic_id: 7489 reply_id: 29108[/import]

That’s awesome, thanks Tom. Will let you know if I encounter any issues, but so far none (been using 318 all day). [import]uid: 7849 topic_id: 7489 reply_id: 29111[/import]

Excellent Tom - no more need for monkey-patching the Corona-core…

-FrankS.
[import]uid: 8093 topic_id: 7489 reply_id: 29114[/import]

This should also fix the memory leak associated with Movieclips. The Movieclip library creates a group of images and then removes the group.

I’m glad this was fixed and avoids having to use the workarounds associated with removing groups and objects. The workarounds won’t hurt but getting this fixed will make it easier to document how to use the APIs and makes it easier to use.

Thanks,
Tom [import]uid: 7559 topic_id: 7489 reply_id: 29115[/import]

What? removing a group doesn’t remove all of it’s child objects???

That’s ludicrous [import]uid: 4596 topic_id: 7489 reply_id: 29197[/import]

@Tom:

>> Any global event listeners (Runtime:AddEventListener) will still need to be removed manually

I can understand that if you register only a handler-function with Runtime, you cannot remove anything, but if you register a table-listener, then the Corona-runtime should be able to detect that the associated object has been self-Removed already and not invoke the handler and remove it from its handler list.

Is that implemented already ?
@singh206:

Not sure what you are referring to, but as I understand it, Tom just made that work…
The only thing he cannot do, is clean-up the orphaned objects which potentially have been decorated with additional properties and is held onto by explicit references in the code. Those orphans, however, will be garbage collected the normal way when no more references exist.
[import]uid: 8093 topic_id: 7489 reply_id: 29212[/import]

Also, based on the underlining “removeSelf” code, any object listeners associated with the objects in the group, should be removed by the Lua garbage collection since the objects themselves are removed. This means there should be no need to object:removeEventListener for objects in the group.

awesome, this will help with buttons from ui.lua

Months ago I was incorrectly told that removeSelf removes touch event listeners on the removed objects; now that is actually true. [import]uid: 12108 topic_id: 7489 reply_id: 29216[/import]

We are developing on Windows here using the latest (stable) Windows version of Corona.

As we built an iPhone version of our app using the latest Mac version, we encountered HEAVY frame rate drops in our game each time a level was restarted. Each time the level got restarted, the game got slower and slower, down to 1 FPS on an iPod 4.

It took hours to track down the issue and it turned out that the Mac version does NOT clean Groups recursively (while the Windows version probably does).

After using the custom recursive method found above, the problem was solved.

Please Ansca:

* We don’t understand, why recursive cleaning of groups was not implemented from the beginning. This is what EVERY Corona user would expect when using groups.

* If the workaround is so simple (see above), why isn’t it implemente yet? I guess there are tons of Corona apps out there now causing memory leaks. This is NOT a good promotion for Corona =( You should really fix this instead forcing us to use any “hacks”.

* Please add an explicit warning to the docs, this will save users tons of time.

* ANY user will notice this bug, because creating groups and adding objects to them is what even a basic level user does day by day. So there is no chance to get around this issue.

Therefore, you should really address this issue and give it an ultra high ranking -as fast as possible, because it’s simply a bad reputation if Corona apps are causing memory leaks and slow down the device. I don’t want to know how many apps are out there now causing exactly this problem.
[import]uid: 9644 topic_id: 7489 reply_id: 29779[/import]

By latest Mac version do you mean 268 or the latest daily build?

The issue has been fixed in the Daily Builds… but if you ARE using daily builds, then this could be a new issue that is not known.

From what I gather from your post, I’m pretty sure you’re using the latest stable though (268). [import]uid: 7849 topic_id: 7489 reply_id: 29783[/import]

Hello, so now, with daily build, group:removeSelf() will remove and free all content objects: images, other groups, recursively ?

We not need to iterate group and do removeSelf for each object/group ?

Regards.
Francisco. [import]uid: 11749 topic_id: 7489 reply_id: 29809[/import]

Yes, we’re using the latest stable and I wouldn’t recommend to use the daily builds if you are about to deploy your app. They’re good to test new features (regarding this it’s a really good idea to provide daily builds), but you never know if those new features are stable enough for an app release yet or if you even get some new issues then. So I hope that recursive cleaning of groups will make it into the next (stable) Mac release as soon as possible. [import]uid: 9644 topic_id: 7489 reply_id: 29823[/import]

@MauMau, the daily builds is a what will be in the upcoming release so the remove Group fix will be in the next release (unless we find problems with the fix).

The Windows SDK is built from the same code base as the Mac version so it will work the same except in areas that are hardware specific (between Mac and Windows hardware). [import]uid: 7559 topic_id: 7489 reply_id: 29831[/import]

Guys,

I need beta testers for the Director 1.3 on the link below:

https://bitbucket.org/ricardorauber/corona/downloads/director_by_ricardo_rauber_1_3.zip

Please send me some feedback.

Thanks!

Ricardo [import]uid: 8556 topic_id: 7489 reply_id: 34201[/import]

Ricardo, are we going to be able to add pause-menus and other small screens on top of other screens with 1.3? [import]uid: 14018 topic_id: 7489 reply_id: 34672[/import]

Yes, there is a popup that shows a scene without cleaning the current one. [import]uid: 8556 topic_id: 7489 reply_id: 34680[/import]

That’s great stuff!! [import]uid: 14018 topic_id: 7489 reply_id: 34682[/import]