-
Notifications
You must be signed in to change notification settings - Fork 911
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
Fix a memory leak on listener #10294
Conversation
src/sql/workbench/services/objectExplorer/browser/dragAndDropController.ts
Show resolved
Hide resolved
I have a hunch that the test itself was incorrect here, but I'm not entirely sure. If anyone is familiar with this space, please take a look at the changes I've made to the tests. |
@@ -603,7 +603,7 @@ suite('ConnectionConfig', () => { | |||
providerName: 'MSSQL', | |||
options: {}, | |||
saveProfile: true, | |||
id: 'server3', | |||
id: 'server3-2', |
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.
I'm not sure this is correct? The ids should be different but currently your update changes them to both be the same.
What was the error you were seeing?
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.
Well, the tests were failing since this wasn't throwing.
Before, instead of comparing the IDs we were comparing the getConnectionInfoId(), which is somewhat different.
Hmm. I'll see if I can do this without converting to a ConnectionProfile
The PR validation failure is because github had a short downtime. |
* Fix leak * We don't need the full connection profiles for drag drop control * Remove unused code * Change test definition * Change test definition * Change equality check
This method was ending up creating a new instance of ConnectionProfile, which ended up listening onto an event.
Before this change, if you dragged a server from the OE around ADS you would end up with over 1000 instances of
ProviderConnectionInfo
within a second.I think this is how memoize was meant to be used, please let me know if this isn't how it was meant to be used. If not I can make my own caching table instead.