[runtime] Work around static analyzer warning about incorrect refcount decrement. (#1718)

This warning:

    shared.m:216:3: warning: Incorrect decrement of the reference count of an object that is not owned at this point by the caller
                    [pool release];
                    ^~~~~~~~~~~~~~

is somewhat incorrect, because we're using NSAutoreleasePools in uncommon ways
(at the same time it's not entirely incorrect either, because we're not
following Apple's documentation about how to use NSAutoreleasePools).

Luckily calling [NSAutoreleasePool drain] is equivalent to [NSAutoreleasePool
release], so just replace the latter with the former to silence the warning,
since clang doesn't know those two are equivalent.
This commit is contained in:
Rolf Bjarne Kvinge 2017-02-20 19:30:23 +01:00 коммит произвёл GitHub
Родитель e5d601c8a5
Коммит 679b981b66
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -213,7 +213,7 @@ xamarin_thread_finish (void *user_data)
pthread_mutex_unlock (&thread_hash_lock);
if (pool)
[pool release];
[pool drain];
MONO_EXIT_GC_SAFE;
}