[Gambas-user] "mutex" applications

Bruce bbruen at ...2308...
Thu Jun 7 04:39:52 CEST 2012


On Wed, 2012-06-06 at 21:49 -0400, nando wrote:
> I'd like to suggest a form property called 'Singleton'
> when _new or _init is called (whichever creates the object)
> then it will not create a second and only
> return the first instance of it.  Somewhat like a module.

nando,

That is quite easy to implement (for forms and any class) using a static
boolean set true in the _Init() method and checked in the _New() method.

This is a different thing altogether, I am trying to ensure that only
one instance of an application is running.

regards
Bruce





More information about the User mailing list