File tree 1 file changed +11
-10
lines changed
1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -154,18 +154,19 @@ public string ClientHandle
154
154
public void ReadGhostscriptPipeOutput ( object state )
155
155
{
156
156
// create BinaryReader instance through which we will read out Ghostscript output
157
- BinaryReader reader = new BinaryReader ( _pipe ) ;
158
-
159
- // allocate memory space for the incoming output data
160
- byte [ ] buffer = new byte [ _pipe . InBufferSize ] ;
157
+ using ( BinaryReader reader = new BinaryReader ( _pipe ) )
158
+ {
159
+ // allocate memory space for the incoming output data
160
+ byte [ ] buffer = new byte [ _pipe . InBufferSize ] ;
161
161
162
- int readCount = 0 ;
162
+ int readCount = 0 ;
163
163
164
- // read untill we have something to read
165
- while ( ( readCount = reader . Read ( buffer , 0 , buffer . Length ) ) > 0 )
166
- {
167
- // write the output to our local memory stream
168
- _data . Write ( buffer , 0 , readCount ) ;
164
+ // read untill we have something to read
165
+ while ( ( readCount = reader . Read ( buffer , 0 , buffer . Length ) ) > 0 )
166
+ {
167
+ // write the output to our local memory stream
168
+ _data . Write ( buffer , 0 , readCount ) ;
169
+ }
169
170
}
170
171
}
171
172
You can’t perform that action at this time.
0 commit comments