| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 6a3cfc8 commit 98da1fa
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -151,18 +151,12 @@ internal static void Initialize(bool initSigs = false, ShutdownMode mode = Shutd | |||
| 151 | 151 | { | |
| 152 | 152 | PyEval_InitThreads(); | |
| 153 | 153 | } | |
| 154 | - if (mode == ShutdownMode.Soft) | ||
| 155 | - { | ||
| 156 | - RuntimeState.Save(); | ||
| 157 | - } | ||
| 158 | - #if !NETSTANDARD | ||
| 159 | 154 | // XXX: Reload mode may reduct to Soft mode, | |
| 160 | 155 | // so even on Reload mode it still needs to save the RuntimeState | |
| 161 | - else if (mode == ShutdownMode.Reload) | ||
| 156 | + if (mode == ShutdownMode.Soft || mode == ShutdownMode.Reload) | ||
| 162 | 157 | { | |
| 163 | 158 | RuntimeState.Save(); | |
| 164 | 159 | } | |
| 165 | - #endif | ||
| 166 | 160 | } | |
| 167 | 161 | else if (!fromPython) | |
| 168 | 162 | { | |
@@ -190,13 +184,11 @@ internal static void Initialize(bool initSigs = false, ShutdownMode mode = Shutd | |||
| 190 | 184 | ||
| 191 | 185 | // Initialize modules that depend on the runtime class. | |
| 192 | 186 | AssemblyManager.Initialize(); | |
| 193 | - #if !NETSTANDARD | ||
| 194 | 187 | if (mode == ShutdownMode.Reload && RuntimeData.HasStashData()) | |
| 195 | 188 | { | |
| 196 | 189 | RuntimeData.RestoreRuntimeData(); | |
| 197 | 190 | } | |
| 198 | 191 | else | |
| 199 | - #endif | ||
| 200 | 192 | { | |
| 201 | 193 | PyCLRMetaType = MetaType.Initialize(); // Steal a reference | |
| 202 | 194 | ImportHook.Initialize(); | |
@@ -342,9 +334,7 @@ static ShutdownMode TryDowngradeShutdown(ShutdownMode mode) | |||
| 342 | 334 | if ( | |
| 343 | 335 | mode == Runtime.ShutdownMode | |
| 344 | 336 | || mode == ShutdownMode.Normal | |
| 345 | - #if !NETSTANDARD | ||
| 346 | 337 | || (mode == ShutdownMode.Soft && Runtime.ShutdownMode == ShutdownMode.Reload) | |
| 347 | - #endif | ||
| 348 | 338 | ) | |
| 349 | 339 | { | |
| 350 | 340 | return mode; | |
@@ -374,12 +364,10 @@ internal static void Shutdown(ShutdownMode mode) | |||
| 374 | 364 | { | |
| 375 | 365 | RunExitFuncs(); | |
| 376 | 366 | } | |
| 377 | - #if !NETSTANDARD | ||
| 378 | 367 | if (mode == ShutdownMode.Reload) | |
| 379 | 368 | { | |
| 380 | 369 | RuntimeData.Stash(); | |
| 381 | 370 | } | |
| 382 | - #endif | ||
| 383 | 371 | AssemblyManager.Shutdown(); | |
| 384 | 372 | ImportHook.Shutdown(); | |
| 385 | 373 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -459,7 +459,6 @@ internal static SlotsHolder SetupMetaSlots(Type impl, IntPtr type) | |||
| 459 | 459 | ||
| 460 | 460 | Marshal.WriteIntPtr(type, TypeOffset.tp_methods, mdefStart); | |
| 461 | 461 | ||
| 462 | - #if !NETSTANDARD | ||
| 463 | 462 | // XXX: Hard code with mode check. | |
| 464 | 463 | if (Runtime.ShutdownMode != ShutdownMode.Reload) | |
| 465 | 464 | { | |
@@ -470,7 +469,6 @@ internal static SlotsHolder SetupMetaSlots(Type impl, IntPtr type) | |||
| 470 | 469 | Marshal.WriteIntPtr(t, offset, IntPtr.Zero); | |
| 471 | 470 | }); | |
| 472 | 471 | } | |
| 473 | - #endif | ||
| 474 | 472 | return slotsHolder; | |
| 475 | 473 | } | |
| 476 | 474 | ||
@@ -480,10 +478,8 @@ private static IntPtr AddCustomMetaMethod(string name, IntPtr type, IntPtr mdef, | |||
| 480 | 478 | ThunkInfo thunkInfo = Interop.GetThunk(mi, "BinaryFunc"); | |
| 481 | 479 | slotsHolder.KeeapAlive(thunkInfo); | |
| 482 | 480 | ||
| 483 | - #if !NETSTANDARD | ||
| 484 | 481 | // XXX: Hard code with mode check. | |
| 485 | 482 | if (Runtime.ShutdownMode != ShutdownMode.Reload) | |
| 486 | - #endif | ||
| 487 | 483 | { | |
| 488 | 484 | IntPtr mdefAddr = mdef; | |
| 489 | 485 | slotsHolder.AddDealloctor(() => | |
| Back | FazBrowse Home | New Git URL |
0 commit comments