mirror of
https://github.com/rivo/tview.git
synced 2026-04-26 13:25:51 +03:00
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/tview#1023
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?
📋 Pull Request Information
Original PR: https://github.com/rivo/tview/pull/706
Author: @darkhz
Created: 3/7/2022
Status: ❌ Closed
Base:
master← Head:blank_table_app_deadlock📝 Commits (1)
eb2c5c8Fix application deadlock on keyevent in blank selectable Table. Fixes #705📊 Changes
1 file changed (+7 additions, -0 deletions)
View changed files
📝
table.go(+7 -0)📄 Description
Please see #705 for the initial details.
The issue occurs at this line:
As mentioned before, the Table is selectable, so the condition
!cell.NotSelectablewill return false, so the function does not return.In a blank table with no rows and no columns,
t.content.GetColumnCount()andt.content.GetRowCount()will return 0, and thereforelastColumnandrowCountwill be evaluated to -1 and 0 respectively, which in turn will setselectedColumnandselectedRowto -1.Consequently,
t.selectedColumnandt.selectedRowwill not matchstartColumnandstartRowrespectively, and therefore the function will not return. This in turn causes an infinite loop, with very high CPU usage.A possible fix is to check whether
lastColumnandrowCount-1are negative values, before proceeding further.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.