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

Java bindings property notifications #104

Closed
wants to merge 2 commits into from

Conversation

Rugvip
Copy link
Contributor

@Rugvip Rugvip commented Dec 15, 2014

I'm not sure how to solve signal disconnection, but the only two alternatives that I see are: return a handler object with a disconnect() method, or have add a removeChangeListener method and figure out a way to disconnect the correct handler. Either way the API won't change, so this should be fine to add as is.

@sdroege
Copy link
Contributor

sdroege commented Dec 15, 2014

I would just connect the native listener dispatcher to the signal during instantiation of the managed object, and disconnect it when the managed object is finalized.

@sdroege
Copy link
Contributor

sdroege commented Dec 15, 2014

Alternatively allow setting a null listener (i.e. unsetting of the listener), and there disconnect.

@sdroege
Copy link
Contributor

sdroege commented Dec 15, 2014

g_signal_handlers_disconnect_by_func() might also be useful if you don't want to keep the signal handler ids from g_signal_connect() around

@Rugvip
Copy link
Contributor Author

Rugvip commented Dec 15, 2014

So i guess the conclusion from the discussion on IRC is that both addListener/removeListener and setListener are possible to implement using hashtables in Java or GObject data, just need to decide which one we want.

@superdump
Copy link
Contributor

Any pros/cons?

@Rugvip
Copy link
Contributor Author

Rugvip commented Jan 7, 2015

I went with the add/remove approach, although in a separate commit. I'll probably close this PR.

@Rugvip
Copy link
Contributor Author

Rugvip commented Jan 16, 2015

This was implemented in #114 using add/remove approach.

@Rugvip Rugvip closed this Jan 16, 2015
@Rugvip Rugvip deleted the java-notify-prop branch January 18, 2015 11:19
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.

3 participants