Fix improper use of RMVPool.
This commit is contained in:
@@ -186,7 +186,6 @@ namespace Cryville.Crtr.Event {
|
||||
child.Value.CopyTo(ct, dest.Children[child.Key]);
|
||||
ValidateChildren();
|
||||
|
||||
RMVPool.ReturnAll();
|
||||
dest.PlayingMotions.Clear();
|
||||
foreach (var m in PlayingMotions) dest.PlayingMotions.Add(m.Key, m.Value);
|
||||
}
|
||||
@@ -324,11 +323,14 @@ namespace Cryville.Crtr.Event {
|
||||
if (ev.Unstamped is Chart.Motion) {
|
||||
var tev = (Chart.Motion)ev.Unstamped;
|
||||
var mv = RMVPool.Rent(tev.Name);
|
||||
mv.CloneTypeFlag = CloneType;
|
||||
GetMotionValue(tev.Name).CopyTo(mv);
|
||||
PlayingMotions.Add(ev, mv);
|
||||
Callback(ev, callback);
|
||||
if (!ev.Unstamped.IsLong)
|
||||
if (!ev.Unstamped.IsLong) {
|
||||
PlayingMotions.Remove(ev);
|
||||
RMVPool.Return(mv);
|
||||
}
|
||||
}
|
||||
else if (ev.Unstamped is EventContainer) {
|
||||
var cev = (EventContainer)ev.Unstamped;
|
||||
@@ -348,6 +350,8 @@ namespace Cryville.Crtr.Event {
|
||||
var nev = tev.Original;
|
||||
if (nev is Chart.Motion) {
|
||||
Callback(ev, callback);
|
||||
var mv = PlayingMotions[ev.Origin];
|
||||
if (mv.CloneTypeFlag == CloneType) RMVPool.Return(mv);
|
||||
PlayingMotions.Remove(ev.Origin);
|
||||
}
|
||||
else if (nev is EventContainer) {
|
||||
|
@@ -171,6 +171,7 @@ namespace Cryville.Crtr {
|
||||
public class RealtimeMotionValue {
|
||||
public Vector AbsoluteValue;
|
||||
List<MotionNode> RelativeNodes;
|
||||
internal byte CloneTypeFlag;
|
||||
|
||||
public RealtimeMotionValue Init(Vector init) {
|
||||
RelativeNodes = new List<MotionNode> {
|
||||
|
Reference in New Issue
Block a user