Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
brianquinlan committed Oct 1, 2024
1 parent c9e17ad commit c67c4b8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkgs/objective_c/src/input_stream_adapter.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ + (instancetype)inputStreamWithPort:(Dart_Port)sendPort {
stream->_done = NO;
stream->_status = NSStreamStatusNotOpen;
stream->_error = nil;
// From https://developer.apple.com/documentation/foundation/nsstream:
// "...by a default, a stream object must be its own delegate..."
stream->_delegate = stream;
}
return stream;
Expand Down Expand Up @@ -90,6 +92,9 @@ - (BOOL)setProperty:(id)property forKey:(NSStreamPropertyKey)key {
}

- (void)setDelegate:(id<NSStreamDelegate>)delegate {
// From https://developer.apple.com/documentation/foundation/nsstream:
// "...so a delegate message with an argument of nil should restore this
// delegate..."
if (delegate == nil) {
_delegate = self;
} else {
Expand Down

0 comments on commit c67c4b8

Please sign in to comment.