Singleton
- From: "Alan T" <alanNOSPAMpltse@xxxxxxxxxxxx>
- Date: Wed, 16 Jan 2008 11:21:26 +1100
Is this good or bad to make singleton in this way:
Type
TMySingleton = class
private
public
end;
function MySingleton: TMySingleton;
implementation
var
gMySingleton
function MySingleton: TMySingleton;
begin
if gMySingleton = nil then
gMySingleton := TMySingleton.Create;
Result := gMySingleton;
end;
.......
initialization
gMySingleton := nil;
end;
.
- Follow-Ups:
- Re: Singleton
- From: George Shen
- Re: Singleton
- From: Andreas Richter
- Re: Singleton
- From: Ottar Holstad
- Re: Singleton
- From: Lars Frische
- Re: Singleton
- From: Remy Lebeau \(TeamB\)
- Re: Singleton
- From: Jolyon Smith
- Re: Singleton
- From: Wayne Niddery \(TeamB\)
- Re: Singleton
- From: Chris Rolliston
- Re: Singleton
- From: Qi
- Re: Singleton
- Prev by Date: Re: Version control for 3rd-party components: best practices
- Next by Date: Re: Singleton
- Previous by thread: Sage SalesLogix a Delphi app?
- Next by thread: Re: Singleton
- Index(es):