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/11023/head
Teijo Kinnunen 2019-06-03 13:11:07 +03:00 committed by Evelyne Donnaes
parent b421ca6fcc
commit 62c2f38017
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)