//
// cocos2d::CCEGLView::~CCEGLView from 0x1800785b0 to 0x1800786da (298 bytes)
//
// 4 xrefs:
// > sub_180078700 @ 0x18007875e
// > sub_180078700 @ 0x18007871c
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bea1c
//
// 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 11:21:59 +0000
//
void __fastcall cocos2d::CCEGLView::~CCEGLView(cocos2d::CCEGLView *this)
{
_Thrd_t v2; // [rsp+20h] [rbp-18h] BYREF
*(_QWORD *)this = &cocos2d::CCEGLView::`vftable'{for `cocos2d::CCEGLViewProtocol'};
*((_QWORD *)this + 15) = &cocos2d::CCEGLView::`vftable'{for `cocos2d::CCObject'};
byte_1801B2558 = 0;
if ( idThread )
PostThreadMessageA(idThread, 0x12u, 0, 0);
if ( dword_1801B2568 )
{
if ( dword_1801B2568 == Thrd_id() )
{
LABEL_12:
std::_Throw_Cpp_error(5);
JUMPOUT(0x1800786D9LL);
}
v2 = (_Thrd_t)unk_1801B2560;
if ( Thrd_join(&v2, nullptr) )
{
std::_Throw_Cpp_error(2);
__debugbreak();
}
unk_1801B2560 = 0;
}
hWnd = nullptr;
if ( Mtx_lock((_Mtx_t)&unk_1801B2588) )
goto LABEL_12;
if ( dword_1801B25D4 == 0x7FFFFFFF )
{
dword_1801B25D4 = 2147483646;
std::_Throw_Cpp_error(6);
__debugbreak();
}
sub_180078BA0(&qword_1801B25D8);
Mtx_unlock((_Mtx_t)&unk_1801B2588);
sub_1800790C0(&unk_1801B2600);
qword_1801B2540 = nullptr;
sub_1800DB6D0();
cocos2d::CCObject::~CCObject((cocos2d::CCEGLView *)((char *)this + 120));
cocos2d::CCEGLViewProtocol::~CCEGLViewProtocol(this);
}