Fix initialization of deep derived types #353
No reviewers
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
java
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
java-gi/java-gi!353
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "derived-types"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When a new GTypeInstance is initialized, the
instance_init_funcof every class in the parent hierarchy is called, and each time the typeclass pointer is set to that type's typeclass. However, this confused java-gi because it created a Java object of the parent type, instead of the derived class.This is now fixed by using the
gClassparameter of theinstance_init_func, because that parameter actually contains the typeclass we need to create a Java object for.Fixes #351