Closed dmitryd20 closed 10 months ago
Good catch. But I think that solution can be different.
What if we add one more guard-block to unwrap delegate but not fire assertion? It should work also.
What if we add one more guard-block to unwrap delegate but not fire assertion? It should work also.
Sure, your solution looks better
Merged and released in 7.3.9 (SPM - already, Cocoapods - in progress)
Short version of CollectionPluginsChecker looks like this:
CollectionPluginsChecker has weak reference to CollectionDelegate instance, so it is possible that CollectionDelegate is already deallocated when
checkPlugin()
is being called, which leads to an unexpected AssertionFailure. This situation can occur when CollectionManager is removed right after callingddm.forceRefill()
.checkPlugins
insideforceRefill
is called asynchronously and CollectionManager with its delegate are deallocated before one ofcheckPlugin
calls.The described case can be easily fixed with a strong reference to the delegate here.