summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/layout.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/layout.c b/src/layout.c
index 1c341b6..1f90951 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -41,6 +41,7 @@ nslayout_error nslayout_layout_create(
nslayout_layout **layout)
{
nslayout_layout *l = NULL;
+ nslayout_error err;
assert(doc != NULL);
assert(css_ctx != NULL);
@@ -61,8 +62,10 @@ nslayout_error nslayout_layout_create(
l->cb = cb;
l->pw = pw;
- /* TODO: error handling */
- nsl_dom_watcher_add_for_layout(l);
+ err = nsl_dom_watcher_add_for_layout(l);
+ if (err != NSLAYOUT_OK) {
+ return err;
+ }
*layout = l;
return NSLAYOUT_OK;
@@ -73,11 +76,15 @@ nslayout_error nslayout_layout_create(
nslayout_error nslayout_layout_destroy(
nslayout_layout *layout)
{
+ nslayout_error err;
+
assert(layout != NULL);
/* TODO: free/unref the stuff we own in the layout */
- /* TODO: error handling */
- nsl_dom_watcher_remove_for_layout(layout);
+ err = nsl_dom_watcher_remove_for_layout(layout);
+ if (err != NSLAYOUT_OK) {
+ return err;
+ }
free(layout);
return NSLAYOUT_OK;