{"action":"created","issue":{"url":"https://api.github.com/repos/angelsix/solidworks-api/issues/37","repository_url":"https://api.github.com/repos/angelsix/solidworks-api","labels_url":"https://api.github.com/repos/angelsix/solidworks-api/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/angelsix/solidworks-api/issues/37/comments","events_url":"https://api.github.com/repos/angelsix/solidworks-api/issues/37/events","html_url":"https://github.com/angelsix/solidworks-api/issues/37","id":337162457,"node_id":"MDU6SXNzdWUzMzcxNjI0NTc=","number":37,"title":"SetupModelEventHandlers() hooking into events more than once","user":{"login":"mtbayley","id":34929316,"node_id":"MDQ6VXNlcjM0OTI5MzE2","avatar_url":"https://avatars1.githubusercontent.com/u/34929316?v=4","gravatar_id":"","url":"https://api.github.com/users/mtbayley","html_url":"https://github.com/mtbayley","followers_url":"https://api.github.com/users/mtbayley/followers","following_url":"https://api.github.com/users/mtbayley/following{/other_user}","gists_url":"https://api.github.com/users/mtbayley/gists{/gist_id}","starred_url":"https://api.github.com/users/mtbayley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtbayley/subscriptions","organizations_url":"https://api.github.com/users/mtbayley/orgs","repos_url":"https://api.github.com/users/mtbayley/repos","events_url":"https://api.github.com/users/mtbayley/events{/privacy}","received_events_url":"https://api.github.com/users/mtbayley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-29T23:17:04Z","updated_at":"2018-06-30T15:54:56Z","closed_at":null,"author_association":"NONE","body":"I tend to get this when changing configurations.\r\n\r\nAfter a long session, there are hundreds of event handlers hooked causing SW to slow down.\r\n\r\nFor now, this is what I have done. Not sure if this is good practice.\r\n                case ModelType.Assembly:\r\n                    AsAssembly().ActiveConfigChangePostNotify -= ActiveConfigChangePostNotify;\r\n                    AsAssembly().DestroyNotify2 -= FileDestroyNotify;\r\n                    AsAssembly().FileSavePostNotify -= FileSaveNotify;\r\n                    AsAssembly().UserSelectionPostNotify -= UserSelectionPostNotify;\r\n                    AsAssembly().ClearSelectionsNotify -= ClearSelectionsNotify;\r\n                    AsAssembly().ActiveConfigChangePostNotify += ActiveConfigChangePostNotify;\r\n                    AsAssembly().DestroyNotify2 += FileDestroyNotify;\r\n                    AsAssembly().FileSavePostNotify += FileSaveNotify;\r\n                    AsAssembly().UserSelectionPostNotify += UserSelectionPostNotify;\r\n                    AsAssembly().ClearSelectionsNotify += ClearSelectionsNotify;\r\n                    break;\r\nand so on..."},"comment":{"url":"https://api.github.com/repos/angelsix/solidworks-api/issues/comments/401549308","html_url":"https://github.com/angelsix/solidworks-api/issues/37#issuecomment-401549308","issue_url":"https://api.github.com/repos/angelsix/solidworks-api/issues/37","id":401549308,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMTU0OTMwOA==","user":{"login":"angelsix","id":4455939,"node_id":"MDQ6VXNlcjQ0NTU5Mzk=","avatar_url":"https://avatars0.githubusercontent.com/u/4455939?v=4","gravatar_id":"","url":"https://api.github.com/users/angelsix","html_url":"https://github.com/angelsix","followers_url":"https://api.github.com/users/angelsix/followers","following_url":"https://api.github.com/users/angelsix/following{/other_user}","gists_url":"https://api.github.com/users/angelsix/gists{/gist_id}","starred_url":"https://api.github.com/users/angelsix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angelsix/subscriptions","organizations_url":"https://api.github.com/users/angelsix/orgs","repos_url":"https://api.github.com/users/angelsix/repos","events_url":"https://api.github.com/users/angelsix/events{/privacy}","received_events_url":"https://api.github.com/users/angelsix/received_events","type":"User","site_admin":false},"created_at":"2018-06-30T15:54:56Z","updated_at":"2018-06-30T15:54:56Z","author_association":"OWNER","body":"Oh yeah, slightly over-exited event hooking 😃 \r\n\r\nSee if this fixes it and everything still works https://github.com/angelsix/solidworks-api/commit/e015f4b9b347db49b1f0b12e67f96cf83d2e2889. You can just update your NuGet package to 1.0.7.2 if you are using NuGet."}}
{"actor":{"display_login":"angelsix"}}