//
// cocos2d::extension::WebSocket::~WebSocket from 0x1800197d0 to 0x180019885 (181 bytes)
//
// 4 xrefs:
// > sub_180019330 @ 0x18001938e
// > sub_180019330 @ 0x18001934c
// > ??> @ 0x180032408
// > ??> @ 0x18004cbd8
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:15:42 +0000
//
void __fastcall cocos2d::extension::WebSocket::~WebSocket(cocos2d::CCObject **this)
{
cocos2d::CCObject *v2; // rcx
_QWORD *v3; // rcx
__int64 v4; // rbx
__int64 v5; // rsi
void *v6; // rcx
*this = (cocos2d::CCObject *)&cocos2d::extension::WebSocket::`vftable';
cocos2d::extension::WebSocket::close((cocos2d::extension::WebSocket *)this);
v2 = *(this + 11);
if ( v2 )
{
cocos2d::CCObject::release(v2);
*(this + 11) = nullptr;
}
v3 = *(this + 16);
if ( v3[1] )
{
v4 = 0;
v5 = 0;
do
{
v6 = *(void **)((char *)v3 + v4);
if ( v6 )
{
j_j_free(v6);
*(_QWORD *)((char *)*(this + 16) + v4) = 0;
}
v4 = v5 + 56;
v3 = *(this + 16);
v5 = v4;
}
while ( *(_QWORD *)((char *)v3 + v4 + 8) );
}
if ( v3 )
{
j_j_free(v3);
*(this + 16) = nullptr;
}
sub_180003700((__int64)(this + 7));
sub_180003700((__int64)(this + 2));
}