-
Notifications
You must be signed in to change notification settings - Fork 152
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
[GTK3] Do not crash in SetData event #1612
base: master
Are you sure you want to change the base?
Conversation
e3d540c
to
d8ba369
Compare
Test Results 483 files ±0 483 suites ±0 9m 13s ⏱️ +35s For more details on these failures, see this check. Results for commit 09cfb68. ± Comparison against base commit 266cc26. ♻️ This comment has been updated with latest results. |
d8ba369
to
7e7c87c
Compare
Test failures are caused by #1564 |
7c58564
to
b1bf254
Compare
GTK 3.24.41 (Ubuntu 24) crashes when renderers are replaced during render. If replacement is postponed, the crash no longer happens. Fixes eclipse-platform#678.
b1bf254
to
09cfb68
Compare
+1 |
Converting to draft until an alternative of renderer reconfiguration instead of recreation is investigated. |
The alternative is quite complex in comparison and does not avoid the asyncExec(). |
* Otherwise check-boxes will be rendered in columns they are not | ||
* supposed to be rendered in. See bug 513761. | ||
*/ | ||
boolean check = modelIndex == Tree.FIRST_COLUMN && (parent.style & SWT.CHECK) != 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't check
be computed inside getDisplay ().asyncExec (...)
(similarly to modelIndexAsync
and columnAsync
)?.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I've failed to account for column deletion. Thanks.
if (parent.isDisposed () || Math.max (1, parent.getColumnCount ()) <= index) return; | ||
// On multiple resize requests, perform only the last one | ||
if (parent.pixbufHeight != iHeight || parent.pixbufWidth != iWidth) return; | ||
int modelIndexAsync = parent.columnCount == 0 ? Tree.FIRST_COLUMN : parent.columns [index].modelIndex; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible that another column gets inserted at this index after this async task is scheduled but before it's actually executed?
If that's possible, then createRenderers(...)
might not be executed for the original column.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's related to the bug with resizing you are trying to fix. parent.pixbufSizeSet
is set only once per Tree, so the column index is not important 🤷 AFAIK, the only requirement for the column index - the column should exist.
And column may be deleted, so that's a concern worth investigating. Thanks.
The index can't be trusted here and might need to be clamped.
} else { | ||
|
||
GTK.gtk_tree_store_set(parent.modelHandle, handle, modelIndex + Tree.CELL_PIXBUF, pixbuf, -1); | ||
GTK.gtk_tree_store_set(parent.modelHandle, handle, modelIndex + Tree.CELL_SURFACE, surface, -1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is interesting.
So this line was missing before, which means that TreeItem._getImage(int)
always returned null
.
And somehow Tree
still worked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was not missing. I've moved it from below to manage try-finally scope.
Hi @basilevs. |
The crash happens when renderers are replaced during render. If replacement is postponed, the crash no longer happens. The failure only happens in Ubuntu 24 (GTK 3.24.41).
Fixes #678.
Is tested by #1611.