Closed jskeet closed 2 years ago
Currently all of those exceptions are handled and shouldn't really surface. Besides the fact that using exceptions for control flow is probably not a good design decision those exceptions shouldn't prevent anything from being disposed safely or am I missing something?
Only that they're a bit worrying in terms of potentially being a sign of something else being wrong (and showing up in VS output, which makes me wonder whether they're not actually being handled).
I just released a preview version v4.0.0-preview. This is a breaking change, but it should be pretty straight forward to migrate. This version also fixes the "exceptions for control flow" situation in the device Dispose method.
Pls let me know if it works for you.
Fabulous - thanks so much. I'll test all of these over the weekend.
Yup, they all look good for me, thanks - see https://github.com/jskeet/DemoCode/commit/87c8c65d14dbc1710cffc4ba3febe228ff86475d for the migration, if anyone else needs to do the same thing.
@jskeet That's a super useful link that @wischi-chr may wish to link to or reference elsewhere. I saw some comments about having to "migrate" to 4.0.0, but not a super clear example of how to do so.
@ocdtrekkie: Glad it's useful! It's worth noting that this is a fairly simple project - there may well be other migration changes required that I haven't covered, but if it's a useful starting point, that's great :)
@jskeet thank you for sharing the changes you had to make. @ocdtrekkie sadly I'm currently a bit short on time so there is no "good" migration guide at the moment. You could also take a look at the changes of the example projects here.
I added both links (jons DemoCode project and the diff view of the ExampleCollection repository to the README.md of this repository).
Not sure if this is WPF-specific, but I wouldn't have thought so...
To reproduce:
Each time the button is clicked, there are three exceptions:
Is there a safe way of disposing of the deck objects?