-
Notifications
You must be signed in to change notification settings - Fork 231
Remove redundant GC.dispose() calls for Image objects #3692
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
Remove redundant GC.dispose() calls for Image objects #3692
Conversation
| gc.drawRectangle(offset, offset, usableImageSize - offset, usableImageSize - offset); | ||
| gc.fillRectangle(offset + 1, offset + 1, usableImageSize - offset - 1, | ||
| usableImageSize - offset - 1); | ||
| gc.dispose(); |
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.
When will the image of this GC be disposed? It's not that obvious so it might be that this GC lives for a very long time. Couldn't the image creation be changed to an ImageGcDrawer instead?
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.
replaced with ImageGcDrawer
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.
Moved it to seperate PR as the commit message does not fit with the change to ImageGcDrawer
d27685a to
a40ab81
Compare
This minor refactoring eliminates unnecessary calls to GC.dispose() since disposing an Image automatically disposes its associated GC. There is no visual impact from this change.
a40ab81 to
3f40c99
Compare
akoch-yatta
left a comment
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.
LGTM, image is disposed right after
The second place was converted to a ImageGcDrawer and into a separate PR
This minor refactoring removes unnecessary calls to GC.dispose(), as disposing an Image automatically disposes its associated GC.
The images affected by this change are the color-rectangle visuals used in the color selector and syntax coloring. I tested the behavior both before and after the change and observed no visual differences.