Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Reset the delegate properly as specified by the docs.

  • Loading branch information...
commit d863fac0cc9bd65db7f59e2236dd4521f3724eae 1 parent a27eeeb
@bjhomer authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 HSCountingInputStream/HSCountingInputStream.m
View
5 HSCountingInputStream/HSCountingInputStream.m
@@ -58,6 +58,9 @@ - (void)close {
}
- (void)setDelegate:(id<NSStreamDelegate>)aDelegate {
+ if (aDelegate == nil) {
+ delegate = self;
+ }
delegate = aDelegate;
}
@@ -124,7 +127,7 @@ - (BOOL)_setCFClientFlags:(CFOptionFlags)inFlags
if (inCallback != NULL) {
requestedEvents = inFlags;
copiedCallback = inCallback;
- memcpy(&copiedContext, &inContext, sizeof(CFStreamClientContext));
+ memcpy(&copiedContext, inContext, sizeof(CFStreamClientContext));
if (copiedContext.info && copiedContext.retain) {
copiedContext.retain(copiedContext.info);
Please sign in to comment.
Something went wrong with that request. Please try again.