Q:

Weird issue in encapsulated coroutines in Unity

I have a weird problem, that i don't really understand.
Basically i have 3 Classes : A, B and C. Class A and C are attached to a GameObject, Class B not.
Class A:
public class A : MonoBehaviour 
{
    public void Foo() 
    {
        string text = "some text here";
        StartCoroutine(B.Bar(text));
    }
}

Class B:
public class B : MonoBehaviour 
{
    public IEnumerator Bar(string text) 
    {
        // do some stuff
        yield return Something(text);
    }

    public IEnumerator Something(string text) 
    {
        // do some stuff
        yield return C.FooBar(new List<string>(text.Split(someChar)));
        // wait for C.FooBar and do some more stuff
    }    
}

Class C:
public class C : MonoBehaviour
{
    public IEnumerator FooBar(List<string> names) 
    {
        while (names.Length > 0)
        {
            // do some stuff
            yield return new WaitForEndOfFrame();
            names.RemovaAt(0);
        }

    } 
}

The problem is, that B.Something(string text) stops on every yield return (there are some other yield returns in that function, where i must wait for something). But all this worked yesterday after a tons of testing and i don't know, what i am doing wrong and why this suddenly not working.
Do you have any ideas?
Thanks!

A:

The problem was, that the first object was destroyed before the other class' coroutine ended. I still don't get, why it is already worked yesterday, but now i'm waiting for the coroutine and destroy the gameobject after it ends and it works fine now.

