Trying to load a gtk image from a resource causes the JVM to crash #314
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#314
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Hi,
There seems to be something wrong with how images are loaded from resources.
I have a compiled gresource file that includes to a valid
.svgfile. I can see the file when exploring the Resource object usingenumerateChildrenmethod on theResourceobjects. However, if I try to instantiate a gtk image object from said resource, the JVM crashes.Another possible related issue could be that the
application-iconproperty of the AboutDialog also cannot display said icon. It doesn't crash, it just does not load the icon.Here is a snippet of the crash log with the stack trace.
Does the crash happen with any svg file, or only with a specific one? If so, can you please attach it to the issue?
Oh, I think it's a user problem. I was trying to load the image before calling run() on the application, so GTK was not initialized. If I load the image after that, it is fine.
You can reproduce the issue on this fork of the app template project if you still want to see it.
OK, makes sense.