{"action":"opened","issue":{"url":"https://api.github.com/repos/urho3d/Urho3D/issues/1589","repository_url":"https://api.github.com/repos/urho3d/Urho3D","labels_url":"https://api.github.com/repos/urho3d/Urho3D/issues/1589/labels{/name}","comments_url":"https://api.github.com/repos/urho3d/Urho3D/issues/1589/comments","events_url":"https://api.github.com/repos/urho3d/Urho3D/issues/1589/events","html_url":"https://github.com/urho3d/Urho3D/issues/1589","id":177101150,"number":1589,"title":"UnknownComponent may lead to memory corruption","user":{"login":"eugeneko","id":8576192,"avatar_url":"https://avatars.githubusercontent.com/u/8576192?v=3","gravatar_id":"","url":"https://api.github.com/users/eugeneko","html_url":"https://github.com/eugeneko","followers_url":"https://api.github.com/users/eugeneko/followers","following_url":"https://api.github.com/users/eugeneko/following{/other_user}","gists_url":"https://api.github.com/users/eugeneko/gists{/gist_id}","starred_url":"https://api.github.com/users/eugeneko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eugeneko/subscriptions","organizations_url":"https://api.github.com/users/eugeneko/orgs","repos_url":"https://api.github.com/users/eugeneko/repos","events_url":"https://api.github.com/users/eugeneko/events{/privacy}","received_events_url":"https://api.github.com/users/eugeneko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-15T06:41:53Z","updated_at":"2016-09-15T06:41:53Z","closed_at":null,"body":"I've found some bad sequence:\r\n1. I added new component and I used it somewhere in code through GetComponents<>.\r\n2. _I didn't registered it._ Just forgot to.\r\n3. I've manually added it to scene. Just because it was easier.\r\n4. Then my code crashed because UnknownComponent was succesfully casted to MyComponent.\r\n\r\nThis sequence is obviously erroneous, so crash was okay. But what about other possible sequences?\r\n\r\nType hacking under the hood of UnknownComponent look dangerous because it can lead to corrupted pointers. UC is the only Object that cannot be safely casted.\r\nThis type hacking also don't allow to easily fix #1515\r\n\r\nIs this type hacking needed only for displaying propper names in Editor?\r\nIf so, let's think about better solution like GetComponentName/GetDisplayName virtual functions."}}
{"actor":{"display_login":"eugeneko"}}