> LCurrentStatPtr = MemHandleLock(Stat);
> LCurrentStatPtr->RecordCount = 0;
> MemHandleUnlock(Stat);
> MemPtrFree(LCurrentStatPtr);
the call to MemHandleUnlock invalidated LCurrentStatPtr.
try using MemHandleFree(Stat) instead of MemPtrFree.
> LBufferPtr = MemHandleLock(Buff);
> LBufferPtr->TickCount = 0;
> LBufferPtr->MovementNumber = 0;
> MemHandleUnlock(Buff);
> MemPtrFree(LBufferPtr);
same problem, you're invalidating the pointer and then trying to free it.
> LCurrentDynPtr = MemHandleLock(Dyn);
> for (i = 0; i <= 12; i++)
> LCurrentDynPtr->MovementTotals[i] = 0;
> MemHandleUnlock(Dyn);
> MemPtrFree(LCurrentDynPtr);
and a third time.