File tree Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Expand file tree Collapse file tree 1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -107,24 +107,25 @@ internal static void Shutdown()
107
107
}
108
108
109
109
RestoreImport ( ) ;
110
-
111
110
bool shouldFreeDef = Runtime . Refcount ( py_clr_module ) == 1 ;
112
- Runtime . XDecref ( py_clr_module ) ;
113
- py_clr_module = IntPtr . Zero ;
114
- if ( shouldFreeDef )
111
+ #if ! NETSTANDARD
112
+ if ( Runtime . ShutdownMode != ShutdownMode . Reload )
113
+ #endif
115
114
{
116
- ReleaseModuleDef ( ) ;
115
+ Runtime . XDecref ( py_clr_module ) ;
116
+ py_clr_module = IntPtr . Zero ;
117
+ if ( shouldFreeDef )
118
+ {
119
+ ReleaseModuleDef ( ) ;
120
+ }
121
+ Runtime . XDecref ( root . pyHandle ) ;
117
122
}
118
-
119
- Runtime . XDecref ( root . pyHandle ) ;
120
123
root = null ;
121
124
CLRModule . Reset ( ) ;
122
125
}
123
126
124
127
internal static void SaveRuntimeData ( RuntimeDataStorage storage )
125
128
{
126
- Runtime . XIncref ( py_clr_module ) ;
127
- Runtime . XIncref ( root . pyHandle ) ;
128
129
storage . AddValue ( "py_clr_module" , py_clr_module ) ;
129
130
storage . AddValue ( "root" , root . pyHandle ) ;
130
131
}
You can’t perform that action at this time.
0 commit comments