Skip to content

Commit ad36bcd

Browse files
committed
[共通] fix #1154
1 parent beb0444 commit ad36bcd

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Siv3D/include/Siv3D/ConstantBuffer.hpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ namespace s3d
7777
SIV3D_NODISCARD_CXX20
7878
ConstantBuffer(const Type& data);
7979

80-
~ConstantBuffer();
81-
8280
ConstantBuffer& operator =(const Type& data);
8381

8482
[[nodiscard]]
@@ -117,7 +115,15 @@ namespace s3d
117115

118116
ConstantBufferBase m_base;
119117

120-
WrapperType* const m_wrapper = AlignedNew<WrapperType>();
118+
struct Deleter
119+
{
120+
void operator()(WrapperType* p) const
121+
{
122+
AlignedDelete<WrapperType>(p);
123+
}
124+
};
125+
126+
std::unique_ptr<WrapperType, Deleter> m_wrapper{ AlignedNew<WrapperType>() };
121127

122128
bool m_hasDirty = true;
123129
};

Siv3D/include/Siv3D/detail/ConstantBuffer.ipp

-6
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ namespace s3d
2424
m_wrapper->data = data;
2525
}
2626

27-
template <class Type>
28-
inline ConstantBuffer<Type>::~ConstantBuffer()
29-
{
30-
AlignedDelete(m_wrapper);
31-
}
32-
3327
template <class Type>
3428
inline ConstantBuffer<Type>& ConstantBuffer<Type>::operator =(const Type& data)
3529
{

0 commit comments

Comments
 (0)