Skip to content

Commit

Permalink
Avoid unsetting dtor in map/stack_clear functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeDP committed Jan 26, 2019
1 parent d337a5a commit aab983a
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion Lib/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ map_ret_code map_clear(map_t *m) {
clear_elem(m, i);
}
}
m->dtor = NULL;
return MAP_OK;
}

Expand Down
1 change: 0 additions & 1 deletion Lib/stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ stack_ret_code stack_clear(stack_t *s) {
}
}
}
s->dtor = NULL;
return STACK_OK;
}

Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## 4.1.0
- [ ] PoisonPill message to automatically stop another module?
- [ ] In stack_clear and map_clear, avoid unsetting dtor
- [x] In stack_clear and map_clear, avoid unsetting dtor

## Ideas
- [ ] Let contexts talk together? Eg: broadcast(msg, bool global) to send a message to all modules in every context; module_publish message in another context? etc etc
Expand Down
2 changes: 1 addition & 1 deletion docs/src/map.rst
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Where not specified, these functions return a map_ret_code.

.. c:function:: map_clear(m)
Clears a map object by deleting any object inside map, and eventually freeing it too if marked with autofree. Note that map dtor (if any) will be set to NULL too.
Clears a map object by deleting any object inside map, and eventually freeing it too if marked with autofree.

:param s: pointer to map_t
:type s: :c:type:`map_t *`
Expand Down
2 changes: 1 addition & 1 deletion docs/src/stack.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Where not specified, these functions return a stack_ret_code.

.. c:function:: stack_clear(s)
Clears a stack object by deleting any object inside stack, and eventually freeing it too if marked with autofree. Note that stack dtor (if any) will be set to NULL too.
Clears a stack object by deleting any object inside stack, and eventually freeing it too if marked with autofree.

:param s: pointer to stack_t
:type s: :c:type:`stack_t *`
Expand Down

0 comments on commit aab983a

Please sign in to comment.