Thanks - I was ok with destroying it at the end, just the way I had it set up, anyone who made a plugin had to have access to the whole CaptureConsole instance. Because it was disposable, and because the singleton had to be public, I was assuming someone would get the idea to call dispose.
Rethinking, and after reading your comments, I realize I don't really have to make class public, just the events. I guess that will work.. Thanks a lot for your help, Robin ----- Original Message ----- From: "Wyss Clemens" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, June 20, 2003 4:39 AM Subject: Re: [ADVANCED-DOTNET] Singletons and dispose... > I assume you dispose on shutting down. So the referencing objects(tasks) > will also be disposed soon? > > Trivial approach would be to have (two or more) synchronised methods: > writeToConsole > dispose > The dispose method sets the disposedFlag to true and then does all the wipe > up. > The writeToConsole-method checks the disposedFlag before writing to the > writer. > > This could also be implemented using the state-pattern (and > Null/DummyObject-pattern) within the singleton. > > Regards > Clemens > >
