Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug / Crash  App crash after RemoveFromSolver called [4.0.2 and older]
#2
Hi,

In your code you're removing all actors from the solver, even those that have been already removed. Clearing the _GeneratedActors list at the end of RemoveAllGenerated() fixes the issue. Re-(re-re-re- Guiño)removing actors is not good practice, however it should not crash.

There's indeed a bug in Obi that causes redundant removal of cloth actors to unpin memory multiple times. Place lines 214-220 of ObiCloth.cs inside the "if" clause right before them. The entire method should then look like this:

Code:
bool removed = false;

        try{

            // re-enable Unity skinning:
            if (clothMesh != null)
                clothMesh.boneWeights = sharedMesh.boneWeights;

            if (solver != null && InSolver){
                Oni.DestroyDeformableMesh(Solver.OniSolver,deformableMesh);
                deformableMesh = IntPtr.Zero;

                Oni.UnpinMemory(particleIndicesHandle);
                Oni.UnpinMemory(meshTrianglesHandle);
                Oni.UnpinMemory(meshVerticesHandle);
                Oni.UnpinMemory(meshNormalsHandle);
                Oni.UnpinMemory(meshTangentsHandle);
    
                CallOnDeformableMeshTearDown();
            }

        }catch(Exception e){
            Debug.LogException(e);
        }finally{
            removed = base.RemoveFromSolver(info);
        }
        return removed;

Let me know how it goes, and thanks for reporting this!
Reply


Messages In This Thread
RE: App crash after RemoveFromSolver called [4.0.2 and older] - by josemendez - 26-02-2019, 02:22 PM