Skip to content

Commit b079b28

Browse files
authored
* Fix dotnet#2149 * Update MultiNativeContext.cs * Update MultiNativeContext.cs
1 parent 8ac952e commit b079b28

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/Core/Silk.NET.Core/Contexts/MultiNativeContext.cs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#nullable enable
55
using System;
66
using System.Linq;
7+
using Silk.NET.Core.Loader;
78

89
namespace Silk.NET.Core.Contexts
910
{
@@ -30,16 +31,13 @@ public MultiNativeContext(params INativeContext?[] contexts)
3031
/// <inheritdoc />
3132
public nint GetProcAddress(string proc, int? slot = default)
3233
{
33-
foreach (var nativeContext in Contexts)
34+
if (!TryGetProcAddress(proc, out var ret, slot))
3435
{
35-
var ret = nativeContext?.GetProcAddress(proc, slot) ?? default;
36-
if (ret != default)
37-
{
38-
return ret;
39-
}
36+
static void Throw(string fn) => throw new SymbolLoadingException(fn);
37+
Throw(proc);
4038
}
4139

42-
return default;
40+
return ret;
4341
}
4442

4543
/// <inheritdoc />

0 commit comments

Comments
 (0)