[runtime] Prioritize loading a profiler library from the installation dir over standa...
[mono.git] / mono / metadata / profiler.c
index 103e966d948325cdac02c9dddd278cdb3824e6ef..05e8d367a8bdf3a021b697608ec9e61f78f6c4ad 100644 (file)
@@ -1196,17 +1196,15 @@ mono_profiler_load (const char *desc)
                }
                if (!load_embedded_profiler (desc, mname)) {
                        libname = g_strdup_printf ("mono-profiler-%s", mname);
-                       if (!load_profiler_from_directory (NULL, libname, desc)) {
-                               res = FALSE;
 #if defined (MONO_ASSEMBLIES)
-                               res = load_profiler_from_directory (mono_assembly_getrootdir (), libname, desc);
+                       res = load_profiler_from_directory (mono_assembly_getrootdir (), libname, desc);
 #endif
-                               if (!res)
-                                       res = load_profiler_from_mono_instalation (libname, desc);
-
-                               if (!res)
-                                       g_warning ("The '%s' profiler wasn't found in the main executable nor could it be loaded from '%s'.", mname, libname);
-                       }
+                       if (!res)
+                               res = load_profiler_from_directory (NULL, libname, desc);
+                       if (!res)
+                               res = load_profiler_from_mono_instalation (libname, desc);
+                       if (!res)
+                               g_warning ("The '%s' profiler wasn't found in the main executable nor could it be loaded from '%s'.", mname, libname);
                        g_free (libname);
                }
                g_free (mname);