ObjFW  Check-in [1bf3b2ac7c]

Overview
Comment:OFRunLoop: More robust handling of cancels
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1bf3b2ac7c65dffbcb4bc8bf08503c2348223b7fe707e5ad5454604311023e1a
User & Date: js on 2018-08-05 19:27:26
Other Links: manifest | tags
Context
2018-08-05
19:31
OFDNSResolver: Do not close the sockets check-in: 97ccd4a3e4 user: js tags: trunk
19:27
OFRunLoop: More robust handling of cancels check-in: 1bf3b2ac7c user: js tags: trunk
15:24
OFDNSResolver: Let queries time out check-in: 452616df69 user: js tags: trunk
Changes

Modified src/OFRunLoop.m from [3e6c2ca250] to [900992f7d6].

873
874
875
876
877
878
879








880
881
882
883
884
885
886
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894







+
+
+
+
+
+
+
+








			/*
			 * The handler might have called -[cancelAsyncRequests]
			 * so that our queue is now empty, in which case we
			 * should do nothing.
			 */
			if (listObject != NULL) {
				/*
				 * Make sure we keep the target until after we
				 * are done removing the object. The reason for
				 * this is that the target might call
				 * -[cancelAsyncRequests] in its dealloc.
				 */
				[[listObject->object retain] autorelease];

				[queue removeListObject: listObject];

				if ([queue count] == 0) {
					[_kernelEventObserver
					    removeObjectForReading: object];
					[_readQueues
					    removeObjectForKey: object];
909
910
911
912
913
914
915








916
917
918
919
920
921
922
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938







+
+
+
+
+
+
+
+








			/*
			 * The handler might have called -[cancelAsyncRequests]
			 * so that our queue is now empty, in which case we
			 * should do nothing.
			 */
			if (listObject != NULL) {
				/*
				 * Make sure we keep the target until after we
				 * are done removing the object. The reason for
				 * this is that the target might call
				 * -[cancelAsyncRequests] in its dealloc.
				 */
				[[listObject->object retain] autorelease];

				[queue removeListObject: listObject];

				if ([queue count] == 0) {
					[_kernelEventObserver
					    removeObjectForWriting: object];
					[_writeQueues
					    removeObjectForKey: object];