mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-07-31 23:12:52 -05:00
Merge pull request #2629 from ousttrue/fix/fastspringbone_dispose_reentrant
[SpringBone] dispose function can now be executed again
This commit is contained in:
commit
16bf71741f
|
|
@ -118,9 +118,9 @@ namespace UniGLTF.SpringBoneJobs
|
|||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_combinedBuffer is FastSpringBoneCombinedBuffer combined)
|
||||
if (_combinedBuffer != null)
|
||||
{
|
||||
combined.Dispose();
|
||||
_combinedBuffer.Dispose();
|
||||
_combinedBuffer = null;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,8 @@ namespace UniVRM10
|
|||
{
|
||||
m_fastSpringBoneService.BufferCombiner.Register(add: null, remove: m_fastSpringBoneBuffer);
|
||||
m_fastSpringBoneBuffer.Dispose();
|
||||
// #2616
|
||||
m_fastSpringBoneBuffer = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,10 +54,18 @@ namespace UniVRM10
|
|||
|
||||
public void Dispose()
|
||||
{
|
||||
m_bufferCombiner.Register(add: null, remove: m_fastSpringBoneBuffer);
|
||||
m_fastSpringBoneBuffer.Dispose();
|
||||
if (m_fastSpringBoneBuffer != null)
|
||||
{
|
||||
m_bufferCombiner.Register(add: null, remove: m_fastSpringBoneBuffer);
|
||||
m_fastSpringBoneBuffer.Dispose();
|
||||
// #2616
|
||||
m_fastSpringBoneBuffer = null;
|
||||
}
|
||||
|
||||
// re-entrant ok
|
||||
m_fastSpringBoneScheduler.Dispose();
|
||||
|
||||
// re-entrant ok
|
||||
m_bufferCombiner.Dispose();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user