I think you should omit this line (1176), and instead save the incoming close code with _closeCode = code; in the method:  - (void)closeWithCode:(NSInteger)code reason:(NSString *)reason;

This will also work for the ordinary -(void)close: method.