Hi everyone,
I have encountered an error from the corona terminal:
Corona Simulator(645,0xa056e540) malloc: *** error for object 0x176c6e50: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Corona Simulator(645,0xa056e540) malloc: *** error for object 0x176c6150: pointer being freed was not allocated
This started showing up when I started using groups. I have been adding a bunch of objects to groups, then adding them to other groups-effectively removing them from the first group. Also, i have been removing all objects from a group to start over-using a for loop and using the :remove method.
I am not freeing any memory/objects when this error is thrown, so I am not sure why this is happening.
Has anyone else gotten this error and know why it was thrown? Is this possibly a bug in the simulator?
-Amanda
now i have also gotten this error:
*** set a breakpoint in malloc_error_break to debug
/Users/amanda/Documents/Corona.268/Corona Terminal: line 9: 645 Bus error "$path/Corona Simulator.app/Contents/MacOS/Corona Simulator" $*
an object you are assigning or referencing is null - that's what the bus error usually mean.
c
Just to make sure, this is what i am doing:
group1:insert(object)
.
.
.
group2:insert(object)
.
.
.
(later this function is called to remove all the objects):
for i=1, group2.numChildren, 1 do
group2:remove(i)
end
group2 is then repopulated with other objects. It is very possible that i have made a mistake somewhere-I may be referencing something that i have removed prior, but is there anything wrong with this approach? I am not nil-ing anything out, this should not cause a problem? I will go through the code again otherwise
thanks,
amanda
Looks to be like i was referencing something i have removed. Inside the for loop, instead of removing the object i set isVisible=false, and the error is gone.
thanks so much for your help!