ソースを参照

Fix dangling reference warning on assign object property

This doesn't change the behavior, it just silences this compiler warning
when using FMDB in a project that has the
-Wobjc-property-assign-on-object-type warning flag.

https://clang.llvm.org/docs/AutomaticReferenceCounting.html#property-declarations

The alternative would have been to make this a weak property, but this
would have been a behavior change, and after reading the discussion
https://github.com/ccgus/fmdb/issues/522, I gather that this is
something that shouldn't be done in FMDB without bumping the major
version number.
Daniel Seither 3 年 前
コミット
3e5ecb6fee
1 ファイル変更1 行追加1 行削除
  1. 1 1
      src/fmdb/FMDatabasePool.h

+ 1 - 1
src/fmdb/FMDatabasePool.h

@@ -38,7 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 /** Delegate object */
 
-@property (atomic, assign, nullable) id delegate;
+@property (atomic, unsafe_unretained, nullable) id delegate;
 
 /** Maximum number of databases to create */