johnatm / itween

Automatically exported from code.google.com/p/itween
1 stars 2 forks source link

Script with StopByName generates EXC_BAD_ACCESS when using across several scenes #77

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. create 2 scenes each with a gameobject executing code example below
2. starting first scene makes everything work as expected (doesn 't matter 
which scene you start first)
3. Application.LoadLevel (second scene) and run second scene. Call 
SetInitParams(). This will throw error (see below)
4. Build with script call optimisations  "fast but no exceptions"

What is the expected output? What do you see instead?
expected: Stopped iTween with name "rotatebyXYZ". Starting DelayedTween().
instead: something goes wrong with tween destruction.

What version of the product are you using? On what operating system?
2.0.44 with Unity 3.4b4, OSX 10.6.7

Please provide any additional information below.

Error in debugger points to stl_tree.h :
_M_erase(_Link_type __x)
    {
      // Erase without rebalancing.
      while (__x != 0)
    {
      _M_erase(_S_right(__x));
      _Link_type __y = _S_left(__x);
      _M_destroy_node(__x);
      __x = __y;
    }
    }

error output console:
Unhandled Exception: System.NullReferenceException: 
Program received signal:  “EXC_BAD_ACCESS”.
warning: Unable to read symbols for 
/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 
(8C148)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not 
found).
mi_cmd_stack_list_frames: Not enough frames in stack.
mi_cmd_stack_list_frames: Not enough frames in stack.

code example:
private var myRotation : Vector3;
public var rotationMultiplier : float;
public var duration : float;
public var easetype : String = "easeinoutquart";
public var rotateAroundX : boolean;
public var rotateAroundY : boolean;
public var rotateAroundZ : boolean;
public var delayStart : float = 3.1;

function Awake()
{
    iTween.Init(gameObject);
}

function Start()
{
    TweenCustomDelayed();
}

function tween()
{
    myRotation = Vector3(0,0,0);

    if(rotateAroundX)
    {
        myRotation.x = 1;
    }

    if(rotateAroundY)
    {
        myRotation.y = 1;
    }

    if(rotateAroundZ)
    {
        myRotation.z = 1;
    }

    myRotation.Normalize();

    iTween.RotateBy(gameObject,iTween.Hash("name", "rotatebyXYZ", "amount", myRotation*rotationMultiplier, "time", duration, "easetype", easetype, "delay", 0, "space", Space.Self, "oncomplete", "tween"));
}

function SetInitParams()
{
        iTween.StopByName("rotatebyXYZ");
        TweenCustomDelayed();
}

function TweenCustomDelayed()
{
    yield WaitForSeconds(delayStart);
    tween();
}

Original issue reported on code.google.com by alexande...@googlemail.com on 8 Jul 2011 at 6:35

GoogleCodeExporter commented 8 years ago
I'm having the same problem. Did you ever find a workaround on this?

Original comment by ryanniko...@gmail.com on 15 Sep 2011 at 11:58