diff --git a/src/event_handler.c b/src/event_handler.c index e99c208..e827143 100644 --- a/src/event_handler.c +++ b/src/event_handler.c @@ -41,10 +41,7 @@ static void eventHandlerDtor(void * _this) {} -TR_INSTANCE(TR_Hash, _event_methods); TR_INIT_IFACE(TR_Class, eventHandlerCtor, eventHandlerDtor, NULL); -TR_CREATE_CLASS(TR_EventHandler, NULL, NULL, TR_IF(TR_Class)) = { - &(__event_methods.data) -}; +TR_CREATE_CLASS(TR_EventHandler, NULL, NULL, TR_IF(TR_Class)) = { NULL }; // vim: set ts=4 sw=4: diff --git a/src/event_handler_class_cleanup.c b/src/event_handler_class_cleanup.c index 81da87c..877a4eb 100644 --- a/src/event_handler_class_cleanup.c +++ b/src/event_handler_class_cleanup.c @@ -31,7 +31,9 @@ TR__eventHandlerClassCleanup(TR_class_ptr class) while (class) { struct c_TR_EventHandler_vars * vars; vars = (struct c_TR_EventHandler_vars *)class->vars; - TR_hashCleanup(vars->event_methods); + if (vars->event_methods) { + TR_hashCleanup(vars->event_methods); + } class = class->parent; } }