Differences From Artifact [0b0c4f5246]:
- File src/OFZIPArchive.m — part of check-in [c7f0229795] at 2020-01-02 01:51:34 on branch trunk — Update copyright (user: js, size: 23534) [annotate] [blame] [check-ins using] [more...]
To Artifact [f2e2222c23]:
- File
src/OFZIPArchive.m
— part of check-in
[3b43d51006]
at
2020-01-14 00:16:04
on branch trunk
— More consistent -[close] behavior
This means refusing to close twice, calling -[close] from -[dealloc] and
not calling -[cancelAsyncRequests].Calling -[cancelAsyncRequests] in -[close] is too dangerous, as -[close]
gets called by -[dealloc]: If the queue is the last reference to the
object, at the point where -[cancelAsyncRequests] removes it from the
queue, the object will start to deallocate and call into
-[cancelAsyncRequests] again, which is still in the middle of removing
it and now finds itself with an inconsistent state. (user: js, size: 23778) [annotate] [blame] [check-ins using]
︙ | |||
244 245 246 247 248 249 250 | 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | + - + | return self; } #endif - (void)dealloc { if (_stream != nil) |
︙ | |||
613 614 615 616 617 618 619 | 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 | - + | objc_autoreleasePoolPop(pool); } - (void)close { if (_stream == nil) |
︙ | |||
766 767 768 769 770 771 772 | 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 | + - + - - | } return self; } - (void)dealloc { if (_stream != nil || _decompressedStream != nil) |
︙ | |||
843 844 845 846 847 848 849 850 851 852 853 854 855 856 | 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 | + + + | { return ((id <OFReadyForReadingObserving>)_decompressedStream) .fileDescriptorForReading; } - (void)close { if (_stream == nil || _decompressedStream == nil) @throw [OFNotOpenException exceptionWithObject: self]; [_stream release]; _stream = nil; [_decompressedStream release]; _decompressedStream = nil; [super close]; |
︙ | |||
868 869 870 871 872 873 874 | 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 | + - + - | _CRC32 = ~0; return self; } - (void)dealloc { if (_stream != nil) |
︙ | |||
901 902 903 904 905 906 907 | 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 | - + - + + + | return bytesWritten; } - (void)close { if (_stream == nil) |