CThunk: Fix assertion when CThunk object is destroyed

In case the CThunk object is deleted without having called the
entry() function (and thus _entry is NULL), cthunk_free_real()
will fail with an assertion.
pull/10742/head
Teijo Kinnunen 2019-06-03 13:11:07 +03:00
parent f18e3364e9
commit aade299c62
1 changed files with 4 additions and 2 deletions

View File

@ -64,8 +64,10 @@ public:
~CThunk()
{
cthunk_free(_entry);
_entry = NULL;
if (_entry != NULL) {
cthunk_free(_entry);
_entry = NULL;
}
}
inline CThunk(T *instance, CCallbackSimple callback)