File tree Expand file tree Collapse file tree 1 file changed +3
-12
lines changed
Expand file tree Collapse file tree 1 file changed +3
-12
lines changed Original file line number Diff line number Diff line change @@ -69,10 +69,7 @@ public static string ProgramName
6969 }
7070 set
7171 {
72- if ( _programName != IntPtr . Zero )
73- {
74- Marshal . FreeHGlobal ( _programName ) ;
75- }
72+ Marshal . FreeHGlobal ( _programName ) ;
7673 _programName = Runtime . IsPython3
7774 ? UcsMarshaler . GetInstance ( "" ) . MarshalManagedToNative ( value )
7875 : Marshal . StringToHGlobalAnsi ( value ) ;
@@ -93,10 +90,7 @@ public static string PythonHome
9390 }
9491 set
9592 {
96- if ( _pythonHome != IntPtr . Zero )
97- {
98- Marshal . FreeHGlobal ( _pythonHome ) ;
99- }
93+ Marshal . FreeHGlobal ( _pythonHome ) ;
10094 _pythonHome = Runtime . IsPython3
10195 ? UcsMarshaler . GetInstance ( "" ) . MarshalManagedToNative ( value )
10296 : Marshal . StringToHGlobalAnsi ( value ) ;
@@ -117,10 +111,7 @@ public static string PythonPath
117111 }
118112 set
119113 {
120- if ( _pythonPath != IntPtr . Zero )
121- {
122- Marshal . FreeHGlobal ( _pythonPath ) ;
123- }
114+ Marshal . FreeHGlobal ( _pythonPath ) ;
124115 _pythonPath = Runtime . IsPython3
125116 ? UcsMarshaler . GetInstance ( "" ) . MarshalManagedToNative ( value )
126117 : Marshal . StringToHGlobalAnsi ( value ) ;
You can’t perform that action at this time.
0 commit comments