Log in or register to post comments

Frequent malloc errors right before scene change

April 27, 2012 - 12:36am #1

This malloc occurs quite frequently right after a scene change is attempted. I have a regular camera and an AR camera in the scene. Only one is active at a time. The error dump below is for iOS but Android crashes similarly upon scene change as well.

Trackable kklogoqr lost

(Filename: /Applications/buildAgent/work/b0bcff80449a48aa/Runtime/ExportGenerated/iPhonePlayer-armv7/UnityEngineDebug.cpp Line: 43)

appname(1172,0x3f6ec48c) malloc: *** error for object 0x217b650: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug

Re: Frequent malloc errors right before scene change

May 3, 2012 - 3:02pm #8

The error seems to have been due to setting .active . SetActiveRecursively

After changing all instances to .camera = enabled, the error no longer occurs!

I am guessing that the active setting might not have been immediate in some cases, resulting in (silent) unfound object exceptions

Re: Frequent malloc errors right before scene change

April 29, 2012 - 8:53am #7

Can you try posting your log again, or attach it using the Manage Attachments feature.

Re: Frequent malloc errors right before scene change

April 27, 2012 - 3:09pm #6

I copy/pasted the log from xcode.. The crash consistently occurs right after trackable lost. I am not sure how to go deeper into finding out what the 0x references refer to.

My previous method for switching cam involved setting the entire camera gameobject in/active. I will try setting just the camera in/active

Re: Frequent malloc errors right before scene change

April 27, 2012 - 2:53pm #5

http://sites.google.com/site/androidhowto/how-to-1/save-logcat-to-a-text-file

For iOS you can obtain the log from within XCode.

Try switch cams using .enabled = [bool] first and see if that helps.

http://www.unity3dstudent.com/2010/12/switching-cameras-at-runtime/

Re: Frequent malloc errors right before scene change

April 27, 2012 - 2:42pm #4

Is there a recommended method for switching cams? Right now I just .active=false (or SetActiveRecursively) the other and v.v.

Re: Frequent malloc errors right before scene change

April 27, 2012 - 2:41pm #3

What's the best source of logs for this?

Re: Frequent malloc errors right before scene change

April 27, 2012 - 7:22am #2

Can you post the code that you're using to reference and switch the cameras?

Also any logs you have will be helpful.

Log in or register to post comments