diff dwtx/draw2d/geometry/Point.d @ 101:1082a0fc2bb8

First Draw2D example running
author Frank Benoit <benoit@tionex.de>
date Sun, 03 Aug 2008 02:17:46 +0200
parents 95307ad235d9
children
line wrap: on
line diff
--- a/dwtx/draw2d/geometry/Point.d	Sun Aug 03 00:54:29 2008 +0200
+++ b/dwtx/draw2d/geometry/Point.d	Sun Aug 03 02:17:46 2008 +0200
@@ -33,10 +33,16 @@
 
 static final long serialVersionUID = 1;
 /**A singleton for use in short calculations*/
-public static const Point SINGLETON;
-
-static this(){
-    SINGLETON = new Point();
+private static Point SINGLETON_;
+public static Point SINGLETON(){
+    if( SINGLETON_ is null ){
+        synchronized( Point.classinfo ){
+            if( SINGLETON_ is null ){
+                SINGLETON_ = new Point();
+            }
+        }
+    }
+    return SINGLETON_;
 }
 
 /**x value*/