diff options
-rw-r--r-- | subhook.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -145,8 +145,10 @@ class Hook { : hook_(subhook_new(src, dst, (subhook_options_t)options)) {} ~Hook() { - subhook_remove(hook_); - subhook_free(hook_); + if (hook_ != 0) { + subhook_remove(hook_); + subhook_free(hook_); + } } void *GetSrc() { return subhook_get_src(hook_); } |