Optimize GC for motions.
This commit is contained in:
@@ -116,11 +116,6 @@ namespace Cryville.Crtr.Event {
|
||||
r.Values = mvs;
|
||||
|
||||
var cvs = new Dictionary<Identifier, MotionCache>(ChartPlayer.motionRegistry.Count);
|
||||
foreach (var cv in CachedValues) {
|
||||
var dv = r.MCPool.Rent(cv.Key);
|
||||
cv.Value.CopyTo(dv);
|
||||
cvs.Add(cv.Key, dv);
|
||||
}
|
||||
r.CachedValues = cvs;
|
||||
|
||||
r.Children = new Dictionary<EventContainer, ContainerState>();
|
||||
@@ -190,10 +185,12 @@ namespace Cryville.Crtr.Event {
|
||||
if (Disposed) return;
|
||||
Disposed = true;
|
||||
if (CloneType == 1) Handler.Dispose();
|
||||
if (CloneType == 1 || CloneType == 17) {
|
||||
RMVPool.ReturnAll();
|
||||
MCPool.ReturnAll();
|
||||
}
|
||||
foreach (var s in Children)
|
||||
s.Value.Dispose();
|
||||
RMVPool.ReturnAll();
|
||||
MCPool.ReturnAll();
|
||||
}
|
||||
public void DisposeAll() {
|
||||
foreach (var s in Children)
|
||||
|
Reference in New Issue
Block a user