Reputation: 42394
I'm using Ninject for a desktop application. I'm noticing that if I exit the app, singletons that implement IDisposable
are not being disposed.
What is the best practice for ensuring all IDisposable
singleton objects get disposed of properly with Ninject upon exiting a desktop application?
Upvotes: 6
Views: 1312
Reputation: 32725
You have to dispose the kernel in order to dispose the remaining cached objects.
Upvotes: 8