Skip to content

Commit aade299

Browse files
author
Teijo Kinnunen
committed
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.
1 parent f18e336 commit aade299

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

platform/CThunk.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,10 @@ class CThunk: public CThunkBase {
6464

6565
~CThunk()
6666
{
67-
cthunk_free(_entry);
68-
_entry = NULL;
67+
if (_entry != NULL) {
68+
cthunk_free(_entry);
69+
_entry = NULL;
70+
}
6971
}
7072

7173
inline CThunk(T *instance, CCallbackSimple callback)

0 commit comments

Comments
 (0)