| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -212,7 +212,7 @@ static void RunAssemblyAndUnload(Assembly assembly, string assemblyName) | |||
| 212 | 212 | { | |
| 213 | 213 | Console.WriteLine($"[Program.Main] The Proxy object is valid ({theProxy}). Unexpected domain unload behavior"); | |
| 214 | 214 | } | |
| 215 | - catch (Exception) | ||
| 215 | + catch (AppDomainUnloadedException) | ||
| 216 | 216 | { | |
| 217 | 217 | Console.WriteLine("[Program.Main] The Proxy object is not valid anymore, domain unload complete."); | |
| 218 | 218 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -82,7 +82,7 @@ public static void Restore() | |||
| 82 | 82 | var dummyGCAddr = PySys_GetObject("dummy_gc"); | |
| 83 | 83 | if (dummyGCAddr == IntPtr.Zero) | |
| 84 | 84 | { | |
| 85 | - throw new Exception("Runtime state have not set"); | ||
| 85 | + throw new InvalidOperationException("Runtime state have not set"); | ||
| 86 | 86 | } | |
| 87 | 87 | var dummyGC = PyLong_AsVoidPtr(dummyGCAddr); | |
| 88 | 88 | ResotreModules(dummyGC); | |
@@ -122,8 +122,8 @@ private static void RestoreObjects(IntPtr dummyGC) | |||
| 122 | 122 | { | |
| 123 | 123 | throw new Exception("To prevent crash by _PyObject_GC_UNTRACK in Python internal, UseDummyGC should be enabled when using ResotreObjects"); | |
| 124 | 124 | } | |
| 125 | - var intialObjs = PySys_GetObject("initial_objs"); | ||
| 126 | - Debug.Assert(intialObjs != null); | ||
| 125 | + IntPtr intialObjs = PySys_GetObject("initial_objs"); | ||
| 126 | + Debug.Assert(intialObjs != IntPtr.Zero); | ||
| 127 | 127 | foreach (var obj in PyGCGetObjects()) | |
| 128 | 128 | { | |
| 129 | 129 | var p = PyLong_FromVoidPtr(obj); | |
@@ -192,7 +192,7 @@ private static void ExchangeGCChain(IntPtr obj, IntPtr gc) | |||
| 192 | 192 | var head = _Py_AS_GC(obj); | |
| 193 | 193 | if ((long)_PyGCHead_REFS(head) == _PyGC_REFS_UNTRACKED) | |
| 194 | 194 | { | |
| 195 | - throw new Exception("GC object untracked"); | ||
| 195 | + throw new ArgumentException("GC object untracked"); | ||
| 196 | 196 | } | |
| 197 | 197 | unsafe | |
| 198 | 198 | { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments