ecere/net: Properly initialized Service's to -1; Added an extra incref to ServerThrea...
authorJerome St-Louis <jerome@ecere.com>
Sat, 4 Feb 2012 06:57:41 +0000 (13:57 +0700)
committerJerome St-Louis <jerome@ecere.com>
Sat, 4 Feb 2012 06:57:41 +0000 (13:57 +0700)
ecere/src/net/Service.ec
ecere/src/net/dcom.ec
ecere/src/sys/Mutex.ec

index b84ca1f..b6abea0 100644 (file)
@@ -44,6 +44,8 @@ public:
 
    virtual void OnAccept();
 
+   s = -1;
+
    // --- Services ---
 
    bool Start()
index 71e8405..73769e3 100644 (file)
@@ -301,12 +301,13 @@ class DCOMClientThread : Thread
    bool connected;
    unsigned int Main()
    {
-      incref socket;
+      socket._refCount += 2;
       while(connected)
       {
          socket.ProcessTimeOut(0.01);
          semaphore.Release();
       }
+      if(socket._refCount > 1) socket._refCount--;
       delete socket;
       return 0;
    }
index 784eb5a..1711cfb 100644 (file)
@@ -13,7 +13,7 @@ namespace sys;
 import "instance"
 
 #ifdef _DEBUG
-import "System"
+int GetCurrentThreadID();
 #endif
 
 public class Mutex : struct