Browse Source

The base event handler does not handle any event by itself, because of that the event_methods classvar may be NULL.

1.0.0
Georg Hopp 11 years ago
parent
commit
c5fc0fe64d
  1. 5
      src/event_handler.c
  2. 4
      src/event_handler_class_cleanup.c

5
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:

4
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;
}
}

Loading…
Cancel
Save