| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -140,10 +140,12 @@ internal static void Shutdown() | |||
| 140 | 140 | foreach (FieldInfo fi in type.GetFields(BindingFlags.Public | BindingFlags.Static)) | |
| 141 | 141 | { | |
| 142 | 142 | var op = (IntPtr)fi.GetValue(type); | |
| 143 | - if (op != IntPtr.Zero) | ||
| 143 | + if (op == IntPtr.Zero) | ||
| 144 | 144 | { | |
| 145 | - Runtime.XDecref(op); | ||
| 145 | + continue; | ||
| 146 | 146 | } | |
| 147 | + Runtime.XDecref(op); | ||
| 148 | + fi.SetValue(null, IntPtr.Zero); | ||
| 147 | 149 | } | |
| 148 | 150 | Runtime.Py_CLEAR(ref exceptions_module); | |
| 149 | 151 | Runtime.Py_CLEAR(ref warnings_module); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -499,16 +499,9 @@ internal static ThunkInfo GetThunk(MethodInfo method, string funcType = null) | |||
| 499 | 499 | { | |
| 500 | 500 | return ThunkInfo.Empty; | |
| 501 | 501 | } | |
| 502 | - try | ||
| 503 | - { | ||
| 504 | - Delegate d = Delegate.CreateDelegate(dt, method); | ||
| 505 | - var info = new ThunkInfo(d); | ||
| 506 | - return info; | ||
| 507 | - } | ||
| 508 | - catch (Exception) | ||
| 509 | - { | ||
| 510 | - throw; | ||
| 511 | - } | ||
| 502 | + Delegate d = Delegate.CreateDelegate(dt, method); | ||
| 503 | + var info = new ThunkInfo(d); | ||
| 504 | + return info; | ||
| 512 | 505 | } | |
| 513 | 506 | ||
| 514 | 507 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -358,9 +358,7 @@ internal static void Shutdown() | |||
| 358 | 358 | } | |
| 359 | 359 | #endif | |
| 360 | 360 | AssemblyManager.Shutdown(); | |
| 361 | - Exceptions.Shutdown(); | ||
| 362 | 361 | ImportHook.Shutdown(); | |
| 363 | - Finalizer.Shutdown(); | ||
| 364 | 362 | ||
| 365 | 363 | #if !NETSTANDARD | |
| 366 | 364 | if (mode != ShutdownMode.Reload) | |
@@ -377,6 +375,9 @@ internal static void Shutdown() | |||
| 377 | 375 | MetaType.Release(); | |
| 378 | 376 | PyCLRMetaType = IntPtr.Zero; | |
| 379 | 377 | ||
| 378 | + Exceptions.Shutdown(); | ||
| 379 | + Finalizer.Shutdown(); | ||
| 380 | + | ||
| 380 | 381 | if (mode != ShutdownMode.Normal) | |
| 381 | 382 | { | |
| 382 | 383 | PyGC_Collect(); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments