|
-
September 17th, 2002, 05:05 PM
#1
Instance of singleton class is getting garbage collected
I have a singleton class implemented as follows-
// .NET Singleton
sealed class Singleton
{
private Singleton() {}
public static readonly Singleton Instance = new Singleton();
}
as suggested on the MSDN website (http://msdn.microsoft.com/library/de...asp?frame=true)
However, the instance keeps getting garbage collected (that is, the destructor is called).
I read an article that said this was a bug in Java 1.1. Is it the same with C#?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|