mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-02 05:28:48 +00:00
Fix crash when assemblies have empty location string
Fixes bug #604810.
This commit is contained in:
parent
8046a36bb4
commit
9203ed7c9a
1 changed files with 9 additions and 4 deletions
|
@ -74,13 +74,18 @@ namespace Gst {
|
||||||
|
|
||||||
foreach (Assembly asm in assemblies) {
|
foreach (Assembly asm in assemblies) {
|
||||||
foreach (AssemblyName ref_name in asm.GetReferencedAssemblies ()) {
|
foreach (AssemblyName ref_name in asm.GetReferencedAssemblies ()) {
|
||||||
string asm_dir = Path.GetDirectoryName (asm.Location);
|
|
||||||
try {
|
try {
|
||||||
Assembly ref_asm;
|
Assembly ref_asm;
|
||||||
if (File.Exists (Path.Combine (asm_dir, ref_name.Name + ".dll")))
|
if (asm.Location != String.Empty)
|
||||||
ref_asm = Assembly.LoadFrom (Path.Combine (asm_dir, ref_name.Name + ".dll"));
|
{
|
||||||
|
string asm_file = Path.Combine(Path.GetDirectoryName(asm.Location), ref_name.Name + ".dll");
|
||||||
|
if (File.Exists(asm_file))
|
||||||
|
ref_asm = Assembly.LoadFrom(asm_file);
|
||||||
|
else
|
||||||
|
ref_asm = Assembly.Load(ref_name);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
ref_asm = Assembly.Load (ref_name);
|
ref_asm = Assembly.Load(ref_name);
|
||||||
|
|
||||||
Type[] ts = asm.GetTypes ();
|
Type[] ts = asm.GetTypes ();
|
||||||
foreach (Type t in ts) {
|
foreach (Type t in ts) {
|
||||||
|
|
Loading…
Reference in a new issue