Skip to content

Conversation

@merceyz
Copy link
Member

@merceyz merceyz commented Feb 15, 2019

  • Added an IsDisposed property to IWebBrowser
  • Implemented a thread safe dispose pattern
  • Now only disposes of managed objects when disposing is set to true
  • Simplified the handling of design mode and disposing

Resolves #1954

EDIT:
As this is getting merged in parts, here are the relevant commits
OffScreen: 58fac38 b1ef9e8

@AppVeyorBot
Copy link

@cefsharp cefsharp deleted a comment from AppVeyorBot Feb 15, 2019
@AppVeyorBot
Copy link

Copy link
Member

@amaitland amaitland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than adding a comment which I've posted inline for discussion the OffScreen changes look like they can be merged.

Any objection if I merge this one class at a time? (Will take care of that manually myself). Rather than trying to review and test everything all at once, and potentially having this go stale, I think it makes sense to work through them one by one. OffScreen, WPF and WinForms is probably the order of lest to most complex.

@AppVeyorBot
Copy link

@merceyz
Copy link
Member Author

merceyz commented Feb 19, 2019

Any objection if I merge this one class at a time?

I would like to keep these changes together and not split them up, however it's up to you.

Rather than trying to review and test everything all at once, and potentially having this go stale, I think it makes sense to work through them one by one. OffScreen, WPF and WinForms is probably the order of lest to most complex.

The code in all three is basically the same, only difference is WPF and WinForms moves the actual disposing out of the protected virtual void Dispose(bool disposing) so that the designer stays happy

@amaitland
Copy link
Member

I would like to keep these changes together and not split them up, however it's up to you.

It'll be some time before I have a chance to review them all at once. What advantage do you see in trying to merge this all at once? They are unrelated changes from a code point of view.

The code in all three is basically the same, only difference is WPF and WinForms moves the actual disposing out of the protected virtual void Dispose(bool disposing) so that the designer stays happy

It's the sort of thing that's easy to introduce a subtle change, the structure looks fine.

@merceyz
Copy link
Member Author

merceyz commented Feb 19, 2019

It'll be some time before I have a chance to review them all at once. What advantage do you see in trying to merge this all at once? They are unrelated changes from a code point of view.

Less noise in the history, but mainly because i'd like to make more changes to all three at the same time for other things. But go ahead, it's fine by me.

@amaitland
Copy link
Member

changes to all three at the same time for other things

What sort of things exactly? Related to Dispose improvements?

@AppVeyorBot
Copy link

@amaitland
Copy link
Member

OffScreen changes merged in 58fac38

Addition comment added in b1ef9e8

@AppVeyorBot
Copy link

@merceyz
Copy link
Member Author

merceyz commented Mar 1, 2019

What sort of things exactly? Related to Dispose improvements?

First thing that comes to mind that is sort of related is a disposed check in all public functions.

@amaitland
Copy link
Member

Please keep the scope of this PR limited to resolving #1954

@merceyz
Copy link
Member Author

merceyz commented Mar 2, 2019

Of course

@AppVeyorBot
Copy link

@amaitland
Copy link
Member

Will hopefully review/merge the WPF changes in the next few days.

@amaitland amaitland added this to the 73.0.0 milestone Mar 14, 2019
@AppVeyorBot
Copy link

@amaitland
Copy link
Member

@merceyz Thoughts on a Breaking Changes entry for this one? I'm struggling to think of what changes users would need to make, just a slight change in behaviour. Maybe you can think of something.

@merceyz
Copy link
Member Author

merceyz commented Mar 23, 2019

@amaitland The IsDisposed property added to IWebBrowser would break builds for anyone that implements that interface on their own

@merceyz merceyz deleted the dispose-pattern branch March 23, 2019 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants