Skip to content

Commit fea3e9d

Browse files
committed
Changed to a custom deleter for the forward declared SharedTexture type due to a change in constexpr unique_ptr destructors in c++23
1 parent 8a58285 commit fea3e9d

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/msw/AX-MediaPlayerMSWDXGIRenderPath.cxx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ namespace AX::Video
7777
return *kInteropContext;
7878
}
7979

80+
void DXGIRenderPath::SharedTextureDeleter::operator ( ) ( SharedTexture* ptr ) const
81+
{
82+
std::default_delete<SharedTexture> deleter;
83+
deleter ( ptr );
84+
}
85+
86+
static DXGIRenderPath::SharedTextureDeleter kSharedTextureDeleter;
87+
8088
class DXGIRenderPath::SharedTexture
8189
{
8290
public:
@@ -158,7 +166,7 @@ namespace AX::Video
158166

159167
SharedTextureRef InteropContext::CreateSharedTexture ( const ivec2 & size )
160168
{
161-
auto texture = std::make_unique<SharedTexture> ( size );
169+
auto texture = SharedTextureRef ( new SharedTexture ( size ), kSharedTextureDeleter );
162170
if ( texture->IsValid ( ) ) return std::move ( texture );
163171

164172
return nullptr;

src/msw/AX-MediaPlayerMSWDXGIRenderPath.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ namespace AX::Video
1818
{
1919
public:
2020

21-
class SharedTexture;
22-
using SharedTextureRef = std::unique_ptr<SharedTexture>;
21+
class SharedTexture;
22+
struct SharedTextureDeleter { void operator() ( SharedTexture* ) const; };
23+
using SharedTextureRef = std::unique_ptr<SharedTexture, SharedTextureDeleter>;
2324

2425
DXGIRenderPath ( MediaPlayer::Impl & owner, const ci::DataSourceRef & source );
2526
~DXGIRenderPath ( );

0 commit comments

Comments
 (0)