clear alias in close before resetting the stream to null (#1231)
This commit is contained in:
@@ -1468,7 +1468,8 @@ open(SourceSink, Mode, Stream, StreamOptions) :-
|
|||||||
atom(SourceSink) ->
|
atom(SourceSink) ->
|
||||||
atom_chars(SourceSink, SourceSinkString)
|
atom_chars(SourceSink, SourceSinkString)
|
||||||
; SourceSink = SourceSinkString
|
; SourceSink = SourceSinkString
|
||||||
), '$open'(SourceSinkString, Mode, Stream, Alias, EOFAction, Reposition, Type)
|
),
|
||||||
|
'$open'(SourceSinkString, Mode, Stream, Alias, EOFAction, Reposition, Type)
|
||||||
)
|
)
|
||||||
).
|
).
|
||||||
|
|
||||||
|
|||||||
@@ -2728,12 +2728,12 @@ impl Machine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !stream.is_stdin() && !stream.is_stdout() && !stream.is_stderr() {
|
if !stream.is_stdin() && !stream.is_stdout() && !stream.is_stderr() {
|
||||||
let close_result = stream.close();
|
|
||||||
|
|
||||||
if let Some(alias) = stream.options().get_alias() {
|
if let Some(alias) = stream.options().get_alias() {
|
||||||
self.indices.stream_aliases.remove(&alias);
|
self.indices.stream_aliases.remove(&alias);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let close_result = stream.close();
|
||||||
|
|
||||||
if let Err(_) = close_result {
|
if let Err(_) = close_result {
|
||||||
let stub = functor_stub(atom!("close"), 1);
|
let stub = functor_stub(atom!("close"), 1);
|
||||||
let addr = stream_as_cell!(stream);
|
let addr = stream_as_cell!(stream);
|
||||||
|
|||||||
Reference in New Issue
Block a user