//
// cocos2d::VolatileTexture::~VolatileTexture from 0xb3464c to 0xb34850 (516 bytes)
//
// 3 xrefs:
// > cocos2d::VolatileTexture::removeTexture @ 0xb35a44
// > ??> @ 0x992b8
// > ??> @ 0xb8650
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Alternative name is '_ZN7cocos2d15VolatileTextureD1Ev'
void __fastcall cocos2d::VolatileTexture::~VolatileTexture(cocos2d::VolatileTexture *this)
{
__int64 *v2; // x24
__int64 v3; // x19
__int64 *v4; // x20
void *v5; // x0
cocos2d::CCImage *uiImage; // x0
stl::StringData::Internal *m_data; // x1
char *v8; // x0
stl::StringData::Internal *v9; // x1
char *v10; // x0
stl::StringData::Internal *v11; // x1
char *v12; // x0
unsigned int *v13; // x1
int v14; // w2
unsigned int *v15; // x1
int v16; // w2
unsigned int *v17; // x1
int v18; // w2
cocos2d::VolatileTexture *v19; // [xsp+50h] [xbp+50h] BYREF
v19 = this;
v2 = &cocos2d::VolatileTexture::textures;
v3 = cocos2d::VolatileTexture::textures;
if ( (__int64 *)cocos2d::VolatileTexture::textures == &cocos2d::VolatileTexture::textures )
goto LABEL_9;
do
{
while ( 1 )
{
v4 = *(__int64 **)v3;
if ( this == *(cocos2d::VolatileTexture **)(v3 + 16) )
break;
LABEL_3:
v3 = *(_QWORD *)v3;
if ( v4 == &cocos2d::VolatileTexture::textures )
goto LABEL_7;
}
if ( &v19 == (cocos2d::VolatileTexture **)(v3 + 16) )
{
v2 = (__int64 *)v3;
goto LABEL_3;
}
sub_CD8DA4(v3);
v5 = (void *)v3;
v3 = (__int64)v4;
operator delete(v5);
}
while ( v4 != &cocos2d::VolatileTexture::textures );
LABEL_7:
if ( v2 != v4 )
{
sub_CD8DA4(v2);
operator delete(v2);
}
LABEL_9:
uiImage = this->uiImage;
if ( uiImage )
cocos2d::CCObject::release(uiImage);
m_data = this->m_strText.m_data.m_data;
v8 = (char *)m_data - 24;
if ( (__int64 *)((char *)m_data - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v15 = (unsigned int *)((char *)m_data - 8);
do
v16 = __ldaxr(v15);
while ( __stlxr(v16 - 1, v15) );
}
else
{
v16 = *((_DWORD *)m_data - 2);
*((_DWORD *)m_data - 2) = v16 - 1;
}
if ( v16 <= 0 )
operator delete(v8);
}
v9 = this->m_strFontName.m_data.m_data;
v10 = (char *)v9 - 24;
if ( (__int64 *)((char *)v9 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v17 = (unsigned int *)((char *)v9 - 8);
do
v18 = __ldaxr(v17);
while ( __stlxr(v18 - 1, v17) );
}
else
{
v18 = *((_DWORD *)v9 - 2);
*((_DWORD *)v9 - 2) = v18 - 1;
}
if ( v18 <= 0 )
operator delete(v10);
}
v11 = this->m_strFileName.m_data.m_data;
v12 = (char *)v11 - 24;
if ( (__int64 *)((char *)v11 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v13 = (unsigned int *)((char *)v11 - 8);
do
v14 = __ldaxr(v13);
while ( __stlxr(v14 - 1, v13) );
}
else
{
v14 = *((_DWORD *)v11 - 2);
*((_DWORD *)v11 - 2) = v14 - 1;
}
if ( v14 <= 0 )
operator delete(v12);
}
}