File tree 1 file changed +3
-12
lines changed
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
69
69
}
70
70
set
71
71
{
72
- if ( _programName != IntPtr . Zero )
73
- {
74
- Marshal . FreeHGlobal ( _programName ) ;
75
- }
72
+ Marshal . FreeHGlobal ( _programName ) ;
76
73
_programName = Runtime . IsPython3
77
74
? UcsMarshaler . GetInstance ( "" ) . MarshalManagedToNative ( value )
78
75
: Marshal . StringToHGlobalAnsi ( value ) ;
@@ -93,10 +90,7 @@ public static string PythonHome
93
90
}
94
91
set
95
92
{
96
- if ( _pythonHome != IntPtr . Zero )
97
- {
98
- Marshal . FreeHGlobal ( _pythonHome ) ;
99
- }
93
+ Marshal . FreeHGlobal ( _pythonHome ) ;
100
94
_pythonHome = Runtime . IsPython3
101
95
? UcsMarshaler . GetInstance ( "" ) . MarshalManagedToNative ( value )
102
96
: Marshal . StringToHGlobalAnsi ( value ) ;
@@ -117,10 +111,7 @@ public static string PythonPath
117
111
}
118
112
set
119
113
{
120
- if ( _pythonPath != IntPtr . Zero )
121
- {
122
- Marshal . FreeHGlobal ( _pythonPath ) ;
123
- }
114
+ Marshal . FreeHGlobal ( _pythonPath ) ;
124
115
_pythonPath = Runtime . IsPython3
125
116
? UcsMarshaler . GetInstance ( "" ) . MarshalManagedToNative ( value )
126
117
: Marshal . StringToHGlobalAnsi ( value ) ;
You can’t perform that action at this time.
0 commit comments