ObjFW  Check-in [ae80dcd8e0]

Overview
Comment:runtime: objc_unregisterClass: Get global lock
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: ae80dcd8e05b4904610ba2ec17eb5b29ea54f58d0052076cff1c282ebe2733e6
User & Date: js on 2021-05-02 11:43:38
Other Links: manifest | tags
Context
2021-05-02
11:59
ofhttp: Fix typo check-in: 5a087b5409 user: js tags: trunk
11:43
runtime: objc_unregisterClass: Get global lock check-in: ae80dcd8e0 user: js tags: trunk
11:34
runtime: Name things more consistently check-in: 2b75f9e6a0 user: js tags: trunk
Changes

Modified src/runtime/class.m from [a72b4d25e1] to [70c18ee4cd].

926
927
928
929
930
931
932


933
934
935
936
937
938
939
...
942
943
944
945
946
947
948


949
950
951
952
953
954
955
}

void
objc_unregisterClass(Class class)
{
	static SEL unloadSel = NULL;



	if (unloadSel == NULL)
		unloadSel = sel_registerName("unload");

	while (class->subclassList != NULL && class->subclassList[0] != Nil)
		objc_unregisterClass(class->subclassList[0]);

	if (class->info & OBJC_CLASS_INFO_LOADED)
................................................................................
	objc_hashtable_delete(classes, class->name);

	if (strcmp(class_getName(class), "Protocol") != 0)
		classesCount--;

	unregisterClass(class);
	unregisterClass(class->isa);


}

void
objc_unregisterAllClasses(void)
{
	if (classes == NULL)
		return;







>
>







 







>
>







926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
...
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
}

void
objc_unregisterClass(Class class)
{
	static SEL unloadSel = NULL;

	objc_globalMutex_lock();

	if (unloadSel == NULL)
		unloadSel = sel_registerName("unload");

	while (class->subclassList != NULL && class->subclassList[0] != Nil)
		objc_unregisterClass(class->subclassList[0]);

	if (class->info & OBJC_CLASS_INFO_LOADED)
................................................................................
	objc_hashtable_delete(classes, class->name);

	if (strcmp(class_getName(class), "Protocol") != 0)
		classesCount--;

	unregisterClass(class);
	unregisterClass(class->isa);

	objc_globalMutex_unlock();
}

void
objc_unregisterAllClasses(void)
{
	if (classes == NULL)
		return;