Index: tests/plugin/TestPlugin.m ================================================================== --- tests/plugin/TestPlugin.m +++ tests/plugin/TestPlugin.m @@ -22,11 +22,22 @@ #ifdef OF_OBJFW_RUNTIME # import "runtime/private.h" OF_DESTRUCTOR() { - objc_unregister_class(objc_getClass("TestPlugin")); + Class class = objc_getClass("TestPlugin"); + + if (class == Nil) + /* + * musl has broken dlclose(): Instead of calling the destructor + * on dlclose(), they call it on exit(). This of course means + * that our tests might have already called objc_exit() and the + * class is already gone. + */ + return; + + objc_unregister_class(class); } #endif @implementation TestPlugin - (int)test: (int)num