[CoreFoundation] Remove StructLayout from the DispatchBlock class. (#6383)

The StructLayout is not needed on our classes, since we should never pass them
directly to P/Invokes (the .Handle property should always be used).

So remove the attribute from the DispatchBlock class. It seems DispatchBlock
was a struct in the initial implementation, then became a class as the pull
request in question evolved, but the StructLayout attribute remained.

Removing it also has another advantage: P/Invokes will throw a marshalling
exception if such a class is passed in (instead of the native function doing
random things because we passed in garbage).
This commit is contained in:
Rolf Bjarne Kvinge 2019-06-20 15:16:18 +02:00 коммит произвёл GitHub
Родитель a60f3778c9
Коммит 57ea8dbb91
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 0 добавлений и 1 удалений

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

@ -16,7 +16,6 @@ using Foundation;
namespace CoreFoundation {
#if !COREBUILD
[StructLayout (LayoutKind.Sequential)]
[iOS (8, 0)]
[Mac (10, 10)]
public sealed class DispatchBlock : NativeObject {