Skip to content

Commit

Permalink
Remove incorrect @mainactor annotations (#8224)
Browse files Browse the repository at this point in the history
These functions are called on whatever thread a Realm is first opened on, not
the main thread.
  • Loading branch information
tgoyne authored May 2, 2023
1 parent 06d4a1d commit 2b01018
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ x.y.z Release notes (yyyy-MM-dd)

### Fixed
* <How to hit and notice issue? what was the impact?> ([#????](https://github.com/realm/realm-swift/issues/????), since v?.?.?)
* None.
* Several schema initialization functions had incorrect `@MainActor`
annotations, resulting in runtime warnings if the first time a Realm was
opened was on a background thread
([#8222](https://github.com/realm/realm-swift/issues/8222), since v10.34.0).

<!-- ### Breaking Changes - ONLY INCLUDE FOR NEW MAJOR version -->

Expand Down
2 changes: 1 addition & 1 deletion RealmSwift/AsymmetricObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ extension AsymmetricObject {
It is not considered part of the public API.
:nodoc:
*/
@MainActor public override final class func _getProperties() -> [RLMProperty] {
public override final class func _getProperties() -> [RLMProperty] {
return ObjectUtil.getSwiftProperties(self)
}

Expand Down
2 changes: 1 addition & 1 deletion RealmSwift/EmbeddedObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ extension EmbeddedObject: _RealmCollectionValueInsideOptional {
It is not considered part of the public API.
:nodoc:
*/
@MainActor public override final class func _getProperties() -> [RLMProperty] {
public override final class func _getProperties() -> [RLMProperty] {
return ObjectUtil.getSwiftProperties(self)
}

Expand Down
2 changes: 1 addition & 1 deletion RealmSwift/Object.swift
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ extension Object: _RealmCollectionValueInsideOptional {
It is not considered part of the public API.
:nodoc:
*/
@MainActor public override final class func _getProperties() -> [RLMProperty] {
public override final class func _getProperties() -> [RLMProperty] {
return ObjectUtil.getSwiftProperties(self)
}

Expand Down

0 comments on commit 2b01018

Please sign in to comment.