Differences From Artifact [5a87b27c71]:
- File src/OFURLHandler.m — part of check-in [68214158ee] at 2020-12-21 00:36:46 on branch trunk — Add destructors for global mutexes (user: js, size: 3800) [annotate] [blame] [check-ins using]
To Artifact [83ca64083c]:
- File
src/OFURLHandler.m
— part of check-in
[9cedc18bb3]
at
2020-12-21 21:29:51
on branch trunk
— Don't send messages in destructors
In our tests, we call objc_exit() using atexit(), so the runtime is
already gone by the time any destructors get called. (user: js, size: 3831) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
33 34 35 36 37 38 39 | # import "OFHTTPURLHandler.h" #endif static OFMutableDictionary OF_GENERIC(OFString *, OFURLHandler *) *handlers; #ifdef OF_HAVE_THREADS static OFMutex *mutex; | < > > > | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | # import "OFHTTPURLHandler.h" #endif static OFMutableDictionary OF_GENERIC(OFString *, OFURLHandler *) *handlers; #ifdef OF_HAVE_THREADS static OFMutex *mutex; void releaseMutex(void) { [mutex release]; } #endif @implementation OFURLHandler @synthesize scheme = _scheme; + (void)initialize { if (self != [OFURLHandler class]) return; handlers = [[OFMutableDictionary alloc] init]; #ifdef OF_HAVE_THREADS mutex = [[OFMutex alloc] init]; atexit(releaseMutex); #endif #ifdef OF_HAVE_FILES [self registerClass: [OFFileURLHandler class] forScheme: @"file"]; #endif #if defined(OF_HAVE_SOCKETS) && defined(OF_HAVE_THREADS) |
︙ | ︙ |