Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / metadata / w32handle-namespace.c
index 50ca016f284c309976d362d269afa900fc5f43d9..f45d2efae532dc9487ed5719201516f42a87acaa 100644 (file)
@@ -56,7 +56,7 @@ has_namespace (MonoW32HandleType type)
 typedef struct {
        gpointer ret;
        MonoW32HandleType type;
-       gchar *name;
+       const gchar *name;
 } NamespaceSearchHandleData;
 
 static gboolean
@@ -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;
@@ -103,7 +101,7 @@ mono_w32handle_namespace_search_handle_callback (gpointer handle, gpointer data,
 }
 
 gpointer
-mono_w32handle_namespace_search_handle (MonoW32HandleType type, gchar *name)
+mono_w32handle_namespace_search_handle (MonoW32HandleType type, const gchar *name)
 {
        NamespaceSearchHandleData search_data;