{"action":"created","issue":{"url":"https://api.github.com/repos/commontk/CTK/issues/589","labels_url":"https://api.github.com/repos/commontk/CTK/issues/589/labels{/name}","comments_url":"https://api.github.com/repos/commontk/CTK/issues/589/comments","events_url":"https://api.github.com/repos/commontk/CTK/issues/589/events","html_url":"https://github.com/commontk/CTK/pull/589","id":101457543,"number":589,"title":"BUG: Fixed ctkVTKDataSetArrayComboBox crashing and not updating","user":{"login":"lassoan","id":307929,"avatar_url":"https://avatars.githubusercontent.com/u/307929?v=3","gravatar_id":"","url":"https://api.github.com/users/lassoan","html_url":"https://github.com/lassoan","followers_url":"https://api.github.com/users/lassoan/followers","following_url":"https://api.github.com/users/lassoan/following{/other_user}","gists_url":"https://api.github.com/users/lassoan/gists{/gist_id}","starred_url":"https://api.github.com/users/lassoan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lassoan/subscriptions","organizations_url":"https://api.github.com/users/lassoan/orgs","repos_url":"https://api.github.com/users/lassoan/repos","events_url":"https://api.github.com/users/lassoan/events{/privacy}","received_events_url":"https://api.github.com/users/lassoan/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-17T16:17:12Z","updated_at":"2015-08-17T17:47:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/commontk/CTK/pulls/589","html_url":"https://github.com/commontk/CTK/pull/589","diff_url":"https://github.com/commontk/CTK/pull/589.diff","patch_url":"https://github.com/commontk/CTK/pull/589.patch"},"body":"1. ctkVTKDataSetArrayComboBox caused application crash when it is used for a VTK data set that is generated by a pipeline and the combobox was used for setting active scalar.\r\n\r\nWhen a data set is changed due to a pipeline change, the data set is first reset and then recomputed. During reset the scalars are removed therefore the selection in the combobox is changed to item (-1), which triggers a data update. During update all the scalars are removed (again, so there is no change) but then the scalars are re-added when the data is recomputed. Qt combobox automatically selects the first item if an item is added, therefore the selection changes to the first active scalar. This change triggers a data set update, which starts with a reset. During reste the scalars are removed, therefore the selection in the combobox is changed to item (-1), which triggers a data update... This is an infinite loop, which causes application crash due to stack overflow.\r\n\r\nSolution was to add a NULL item (no active scalar). This is also useful because without a NULL item it is not possible to unselect scalars.\r\nFor backward compatibility reasons, by default NULL item is not added (it is not needed if the combobox is not used for setting the active scalar).\r\n\r\n2. ctkVTKDataSetArrayComboBox did not contain any arrays that were added after the data set and attribute types are added.\r\n\r\nvtkDataSet Modified event is not invoked if arrays are added/removed/renamed, only vtkDataSet.PointData and vtkDataset.CellData object Modified events are invoked. ctkVTKDataSetModel did not observe the point and cell data objects.\r\n\r\nSolution was to add observers to the point and cell data objects."},"comment":{"url":"https://api.github.com/repos/commontk/CTK/issues/comments/131906561","html_url":"https://github.com/commontk/CTK/pull/589#issuecomment-131906561","issue_url":"https://api.github.com/repos/commontk/CTK/issues/589","id":131906561,"user":{"login":"pieper","id":126077,"avatar_url":"https://avatars.githubusercontent.com/u/126077?v=3","gravatar_id":"","url":"https://api.github.com/users/pieper","html_url":"https://github.com/pieper","followers_url":"https://api.github.com/users/pieper/followers","following_url":"https://api.github.com/users/pieper/following{/other_user}","gists_url":"https://api.github.com/users/pieper/gists{/gist_id}","starred_url":"https://api.github.com/users/pieper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pieper/subscriptions","organizations_url":"https://api.github.com/users/pieper/orgs","repos_url":"https://api.github.com/users/pieper/repos","events_url":"https://api.github.com/users/pieper/events{/privacy}","received_events_url":"https://api.github.com/users/pieper/received_events","type":"User","site_admin":false},"created_at":"2015-08-17T17:47:58Z","updated_at":"2015-08-17T17:47:58Z","body":"All sounds like good fixes.\r\n\r\n@jcfr is traveling so maybe @finetjul wants to have a look also.\r\n\r\nI would be fine merging this unless there's an objection."}}