Commit d5541730 authored by Lázár Bence Kis's avatar Lázár Bence Kis
Browse files

Heap corruption debugging

parent ea5b3385
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -62,7 +62,7 @@ struct AnimationTrack : public IAnimationTrack {
    }

    // Update a keyframe at a specific index
    void update_keyframe(size_t index, Keyframe<T> newKeyframe) {
    void update_keyframe(size_t index, Keyframe<T>&& newKeyframe) {
        if (index < m_keyframes.size()) {
            std::swap(m_keyframes[index], newKeyframe);
            sort_keyframes();
+1 −1
Original line number Diff line number Diff line
@@ -178,7 +178,7 @@ struct BezierInterpolator : public Interpolator<T> {

    std::unique_ptr<Interpolator<T>> clone() const override
    {
        return std::make_unique<BezierInterpolator<T>>(*this);
        return std::make_unique<BezierInterpolator<T, Method>>(*this);
    }

private:
+2 −2
Original line number Diff line number Diff line
@@ -33,13 +33,13 @@ public:
    Keyframe(const Keyframe& other)
        : m_time(other.m_time)
        , m_value(other.m_value)
        , m_interpolator(other.m_interpolator->clone()) {}
        , m_interpolator(other.m_interpolator ? other.m_interpolator->clone() : nullptr) {}

    Keyframe& operator=(const Keyframe& other) {
        if (this != &other) {
            m_time = other.m_time;
            m_value = other.m_value;
            m_interpolator = other.m_interpolator->clone();
            m_interpolator = other.m_interpolator ? other.m_interpolator->clone() : nullptr;
        }
        return *this;
    }