Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by [EMAIL PROTECTED]

http://bugzilla.ximian.com/show_bug.cgi?id=78241

--- shadow/78241        2006-05-04 11:06:36.000000000 -0400
+++ shadow/78241.tmp.18995      2006-05-04 11:09:16.000000000 -0400
@@ -376,6 +376,44 @@
 
 ------- Additional Comments From [EMAIL PROTECTED]  2006-05-04 11:06 -------
 I just found out that threads created as a result of
 calling BeginInvoke have an enormous high handle ref
 count (400-500). These are also the handles that leak.
 
+
+------- Additional Comments From [EMAIL PROTECTED]  2006-05-04 11:09 -------
+Very dirty patch for CloseHandle which doesn't completely resolve the
+bug, but there's much less leak with it...
+
+Index: io-layer/handles.c
+===================================================================
+--- io-layer/handles.c  (révision 60249)
++++ io-layer/handles.c  (copie de travail)
+@@ -1160,8 +1160,26 @@
+  */
+ gboolean CloseHandle(gpointer handle)
+ {
+-       _wapi_handle_unref (handle);
+
++       guint32 idx = GPOINTER_TO_UINT (handle);
++       gint32 nbref=_WAPI_PRIVATE_HANDLES(idx).ref;
++       g_message("CloseHandle type :%s:
+nbref=%d",_wapi_handle_typename[_WAPI_PRIVATE_HANDLES (idx).type],nbref);
++
++        if (_WAPI_PRIVATE_HANDLES (idx).type == WAPI_HANDLE_THREAD ||
+_WAPI_PRIVATE_HANDLES (idx).type == WAPI_HANDLE_PROCESS)
++        {
++               do{
++                       if (nbref>0)
++                       _wapi_handle_unref (handle);
++                       nbref--;
++               }
++               while(nbref>0);
++       }
++       else
++       {
++               if (nbref>0)
++                       _wapi_handle_unref (handle);
++       }
++
+        return(TRUE);
+ }
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to