Skip to content

Added final callback after all listeners have been invoked.#6

Open
skywa04885 wants to merge 1 commit into
andsmedeiros:masterfrom
skywa04885:master
Open

Added final callback after all listeners have been invoked.#6
skywa04885 wants to merge 1 commit into
andsmedeiros:masterfrom
skywa04885:master

Conversation

@skywa04885
Copy link
Copy Markdown

When working with dynamic memory or object pools, and the number of listeners is dynamic, I needed to make possible that memory is freed or objects released safely after all listeners have been executed. I added this quickly (not sure if it's up to the standard or design you want), but might be a idea to implement this officially.

Copy link
Copy Markdown
Owner

@andsmedeiros andsmedeiros left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for your contribution! I feel your changes are very plausible and fill in an important usability gap in the framework.

That said, please make these few improvements for me to accept your PR:

  • Un-commit .vscode directory
  • Instead of invoking final_callback in run_signal_event(), invoke it in uel_evloop_run(). This way, we can also implement finalisers for other events later
  • Change uel_event_config_signal signature to take the finaliser as parameter
  • Document your changes in README.md
  • Write unit tests for uel_signal_emit_with_final_callback()
  • Re-generate the Doxygen docs and commit them (right now, your commit deletes our docs)

If you have any trouble, I will gladly help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants