Exemplo n.º 1
0
    public void TearDown()
    {
        if (curveNat.IsCreated)
        {
            curveNat.Dispose();
        }

        if (floatArray.IsCreated)
        {
            floatArray.Dispose();
        }
    }
Exemplo n.º 2
0
    public void TestCanDeallocateOnJobCompletion([Values(Allocator.Persistent, Allocator.TempJob)] Allocator allocator)
    {
        curveRef = new AnimationCurve(new Keyframe(0, 0), new Keyframe(1, 1));
        var toTest = new NativeCurve(curveRef, allocator);

        var job = new JobThatDeallocates()
        {
            Curve = toTest
        }.Schedule();

        job.Complete();

        //We expect that trying to dispose again throws an exception
        Assert.That(() => toTest.Dispose(), Throws.InvalidOperationException);
    }