- finalize_handler = NULL;
- for(li=cl->nodes;li;li=g_list_next(li)) {
- Node *n = li->data;
- if(n->type == METHOD_NODE) {
- Method *m = (Method *)n;
- if(m->method == OVERRIDE_METHOD &&
- strcmp(m->id, "finalize")==0) {
- if(strcmp(m->otype, "G:Object") != 0) {
- error_print(GOB_ERROR, m->line_no,
- "finalize method override "
- "of class other then "
- "G:Object");
- }
- if(g_list_length(m->args) != 1) {
- error_print(GOB_ERROR, m->line_no,
- "finalize method override "
- "with more then one "
- "parameter");
- }
- finalize_handler = m;
- break;
- }
- }
+static void
+find_dispose(const Class *cl)
+{
+ dispose_handler = find_method(cl, OVERRIDE_METHOD, "dispose");
+ if (dispose_handler != NULL) {
+ if(strcmp(dispose_handler->otype, "G:Object") != 0)
+ error_print(GOB_ERROR, dispose_handler->line_no,
+ "dispose method override "
+ "of class other then "
+ "G:Object");
+ if(g_list_length(dispose_handler->args) != 1)
+ error_print(GOB_ERROR, dispose_handler->line_no,
+ "dispose method override "
+ "with more then one "
+ "parameter");
+ }
+
+ user_dispose_method = find_method(cl, DISPOSE_METHOD, NULL);
+}
+
+static void
+find_finalize(const Class *cl)
+{
+ finalize_handler = find_method(cl, OVERRIDE_METHOD, "finalize");
+ if (finalize_handler != NULL) {
+ if(strcmp(finalize_handler->otype, "G:Object") != 0)
+ error_print(GOB_ERROR, finalize_handler->line_no,
+ "finalize method override "
+ "of class other then "
+ "G:Object");
+ if(g_list_length(finalize_handler->args) != 1)
+ error_print(GOB_ERROR, finalize_handler->line_no,
+ "finalize method override "
+ "with more then one "
+ "parameter");