Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

skywa04885
Copy link

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
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