[w32handle] Replace mono_w32handle_{ref,unref} by mono_w32handle_{duplicate, close...
[mono.git] / mono / metadata / w32handle-namespace.c
index 6975c48934b2057e05085f0b65505247bcf934f0..f45d2efae532dc9487ed5719201516f42a87acaa 100644 (file)
@@ -91,9 +91,7 @@ mono_w32handle_namespace_search_handle_callback (gpointer handle, gpointer data,
                                __func__, handle);
 
                        /* we do not want the handle to be destroyed before we return it  */
-                       mono_w32handle_ref (handle);
-
-                       search_data->ret = handle;
+                       search_data->ret = mono_w32handle_duplicate (handle);
                }
 
                return TRUE;