Hello developers, I recently faced a problem with leaking std::shared_ptr object captured in block after Drag and Drop on iOs 13.4.1. To investigate this problem I made simple application based on MasterDetail template, adopt master table view and detail view for drag and drop, i used this functions of NSItemProvider :
- (void)registerDataRepresentationForTypeIdentifier:(NSString *)typeIdentifier visibility:(NSItemProviderRepresentationVisibility)visibility loadHandler:(NSProgress * _Nullable (^)(void (^completionHandler)(NSData * _Nullable data, NSError * _Nullable error)))loadHandler
and this one
- (NSProgress *)loadDataRepresentationForTypeIdentifier:(NSString *)typeIdentifier completionHandler:(void(^)(NSData * _Nullable data, NSError * _Nullable error))completionHandler
So after all I rut it on simulator on iOs 13.5, on real device with iOs 13.4.1 and iOs 12.4.1.
I saw that on real device with iOs 13.4.1 only the block uses in function loadDataRepresentationForTypeIdentifier was not destroyed with my std::shared_ptr object captured in this block. on simulator and on real device with iOs 12.4.1 this block was destroyed. I have used memory graph to see what objects hold this block and my shared object, finally I realised there is a cycle of internal blocks refered to each other.
Here is the link to the MasterDetail project with the Drag and Drop, run it on iPad only to check drag and drop, on iPhone you cann't drop on detail view because master view covers detail view.
https://www.dropbox.com/s/svsf1vf8ly50n04/MasterDetail.zip?dl=0
Can anyone help me to solve this problem or this is proble of iOs 13.4.1?