@@ -1,7 +1,7 @@ /* - * Copyright (c) 2008-2023 Jonathan Schleifer + * Copyright (c) 2008-2024 Jonathan Schleifer * * All rights reserved. * * This file is part of ObjFW. It may be distributed under the terms of the * Q Public License 1.0, which can be found in the file LICENSE.QPL included in @@ -586,12 +586,17 @@ objc_getClassList(Class *buffer, unsigned int count) { unsigned int j; objc_globalMutex_lock(); - if (buffer == NULL) - return classesCount; + if (buffer == NULL) { + count = classesCount; + + objc_globalMutex_unlock(); + + return count; + } if (classesCount < count) count = classesCount; j = 0;