Skip to content

Commit

Permalink
[共通] fix #1154
Browse files Browse the repository at this point in the history
  • Loading branch information
Reputeless committed Nov 26, 2023
1 parent beb0444 commit ad36bcd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 9 additions & 3 deletions Siv3D/include/Siv3D/ConstantBuffer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ namespace s3d
SIV3D_NODISCARD_CXX20
ConstantBuffer(const Type& data);

~ConstantBuffer();

ConstantBuffer& operator =(const Type& data);

[[nodiscard]]
Expand Down Expand Up @@ -117,7 +115,15 @@ namespace s3d

ConstantBufferBase m_base;

WrapperType* const m_wrapper = AlignedNew<WrapperType>();
struct Deleter
{
void operator()(WrapperType* p) const
{
AlignedDelete<WrapperType>(p);
}
};

std::unique_ptr<WrapperType, Deleter> m_wrapper{ AlignedNew<WrapperType>() };

bool m_hasDirty = true;
};
Expand Down
6 changes: 0 additions & 6 deletions Siv3D/include/Siv3D/detail/ConstantBuffer.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ namespace s3d
m_wrapper->data = data;
}

template <class Type>
inline ConstantBuffer<Type>::~ConstantBuffer()
{
AlignedDelete(m_wrapper);
}

template <class Type>
inline ConstantBuffer<Type>& ConstantBuffer<Type>::operator =(const Type& data)
{
Expand Down

0 comments on commit ad36bcd

Please sign in to comment.