Commit c5fc0fe64d330fd714226da20252007ea4ec19fc
1 parent
088d5737
The base event handler does not handle any event by itself, because of that the …
…event_methods classvar may be NULL.
Showing
2 changed files
with
4 additions
and
5 deletions
@@ -41,10 +41,7 @@ static | @@ -41,10 +41,7 @@ static | ||
41 | void | 41 | void |
42 | eventHandlerDtor(void * _this) {} | 42 | eventHandlerDtor(void * _this) {} |
43 | 43 | ||
44 | -TR_INSTANCE(TR_Hash, _event_methods); | ||
45 | TR_INIT_IFACE(TR_Class, eventHandlerCtor, eventHandlerDtor, NULL); | 44 | TR_INIT_IFACE(TR_Class, eventHandlerCtor, eventHandlerDtor, NULL); |
46 | -TR_CREATE_CLASS(TR_EventHandler, NULL, NULL, TR_IF(TR_Class)) = { | ||
47 | - &(__event_methods.data) | ||
48 | -}; | 45 | +TR_CREATE_CLASS(TR_EventHandler, NULL, NULL, TR_IF(TR_Class)) = { NULL }; |
49 | 46 | ||
50 | // vim: set ts=4 sw=4: | 47 | // vim: set ts=4 sw=4: |
@@ -31,7 +31,9 @@ TR__eventHandlerClassCleanup(TR_class_ptr class) | @@ -31,7 +31,9 @@ TR__eventHandlerClassCleanup(TR_class_ptr class) | ||
31 | while (class) { | 31 | while (class) { |
32 | struct c_TR_EventHandler_vars * vars; | 32 | struct c_TR_EventHandler_vars * vars; |
33 | vars = (struct c_TR_EventHandler_vars *)class->vars; | 33 | vars = (struct c_TR_EventHandler_vars *)class->vars; |
34 | - TR_hashCleanup(vars->event_methods); | 34 | + if (vars->event_methods) { |
35 | + TR_hashCleanup(vars->event_methods); | ||
36 | + } | ||
35 | class = class->parent; | 37 | class = class->parent; |
36 | } | 38 | } |
37 | } | 39 | } |
Please
register
or
login
to post a comment