diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2011-12-21 22:18:10 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2011-12-21 22:18:10 +0000 |
commit | 83f3338663c4969eebefd8c2c43bd3fc43587fdd (patch) | |
tree | e48ba69628c5ba793533094e308c1fce9acb21aa /src/events/custom_event.c | |
parent | 4ade8ad1c7b23e6eeeee6681acbdb43fb10cab43 (diff) | |
download | libdom-83f3338663c4969eebefd8c2c43bd3fc43587fdd.tar.gz libdom-83f3338663c4969eebefd8c2c43bd3fc43587fdd.tar.bz2 |
Merge branches/jmb/dom-alloc-purge back to trunk
svn path=/trunk/libdom/; revision=13316
Diffstat (limited to 'src/events/custom_event.c')
-rw-r--r-- | src/events/custom_event.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/events/custom_event.c b/src/events/custom_event.c index 99b4120..76d09bf 100644 --- a/src/events/custom_event.c +++ b/src/events/custom_event.c @@ -5,6 +5,8 @@ * Copyright 2009 Bo Yang <struggleyb.nku@gmail.com> */ +#include <stdlib.h> + #include "events/custom_event.h" #include "core/document.h" @@ -19,7 +21,7 @@ static struct dom_event_private_vtable _event_vtable = { dom_exception _dom_custom_event_create(struct dom_document *doc, struct dom_custom_event **evt) { - *evt = _dom_document_alloc(doc, NULL, sizeof(dom_custom_event)); + *evt = malloc(sizeof(dom_custom_event)); if (*evt == NULL) return DOM_NO_MEM_ERR; @@ -29,12 +31,11 @@ dom_exception _dom_custom_event_create(struct dom_document *doc, } /* Destructor */ -void _dom_custom_event_destroy(struct dom_document *doc, - struct dom_custom_event *evt) +void _dom_custom_event_destroy(struct dom_custom_event *evt) { - _dom_custom_event_finalise(doc, evt); + _dom_custom_event_finalise(evt); - _dom_document_alloc(doc, evt, 0); + free(evt); } /* Initialise function */ @@ -46,17 +47,16 @@ dom_exception _dom_custom_event_initialise(struct dom_document *doc, } /* Finalise function */ -void _dom_custom_event_finalise(struct dom_document *doc, - struct dom_custom_event *evt) +void _dom_custom_event_finalise(struct dom_custom_event *evt) { evt->detail = NULL; - _dom_event_finalise(doc, &evt->base); + _dom_event_finalise(&evt->base); } /* The virtual destroy function */ void _virtual_dom_custom_event_destroy(struct dom_event *evt) { - _dom_custom_event_destroy(evt->doc, (dom_custom_event *) evt); + _dom_custom_event_destroy((dom_custom_event *) evt); } /*----------------------------------------------------------------------*/ |