-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Crash accessing theme dimensions/info in a plugin's init() function #3913
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
Comments
I couldn't reproduce it yet. |
From the stacktrace it looks like a plugin ( https://www.aseprite.org/api/plugin ) accessed a dimension from local dim = app.theme.dimension
local dialog = Dialog("Test")
dialog:button{ text="Click", onclick=function()
app.alert(tostring(dim.scrollbar_size))
end}
dialog:show{ wait=false } The issue is that |
Even with the script, I couldn't reproduce the crash (Windows and macOS). Anyway your consideration is a nice improvement. As you indicate, the structure of ThemeDimension can be modified from this: struct ThemeDimension {
Theme* theme;
ThemeDimension(Theme* theme) : theme(theme) { }
int getById(const std::string& id) const {
return theme->getDimensionById(id);
}
}; To a pointer-less version without side effects (not fully tested yet): struct ThemeDimension {
int getById(const std::string& id) const {
return skin::SkinTheme::instance()->getDimensionById(id);
}
}; |
See if opening the script, refreshing (F5) and then clicking the dialog button produces the crash. Compile with the memory sanitizer. |
I created a test plugin and used app.theme.dimension in the plugin's init() function but still can't reproduce the crash (F5 didn't help, tested on macOS and Windows) |
Sentry Issue: ASEPRITE-14Q
The text was updated successfully, but these errors were encountered: