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

Idea: improve type detection #1124

Open
badcel opened this issue Sep 22, 2024 · 0 comments
Open

Idea: improve type detection #1124

badcel opened this issue Sep 22, 2024 · 0 comments

Comments

@badcel
Copy link
Member

badcel commented Sep 22, 2024

It can happen that the real type can't be detected properly from the type system especially in the case of anonymous classes which implement several interfaces as the first interface is chosen.

To have a way forward the list APIs should have some api to support casting their content to an explicit type defined by the user.

This could be a little tricky as then there could be two instances in the cache for one pointer e.g. one casted to an interface helper and one version casted to a concrete class (e.g. Object).

In this case the toggle references dead lock each other. The documentation states that toggle references should only be used if the proxy object carries custom data. So the idea would be to get rid of toggle references at least for given types and simply always use weak references.

For custom subclasses some solution needs to be found. E.g. a toggle ref or those classes are fully integrated with the GObject type system which has its own set of problems.

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

No branches or pull requests

1 participant