samsao / DataProvider

Data provider is a library made to abstract Table and Collection views boilerplate code.
MIT License
14 stars 6 forks source link

Provider could cause a crash in race condition. #5

Closed ccmjz closed 8 years ago

ccmjz commented 8 years ago

It need a method to nullifyDelegates

GabrielCartier commented 8 years ago

You got any time to actually work on this or fix it?

ccmjz commented 8 years ago

I'll find some time to fix it today.

AlexHmelevski commented 8 years ago

Just curious if it's a race condition how nulifyDelegates will help? it happens due to use it from different threads? how race condition happens?

ccmjz commented 8 years ago

I don't remember it clearly, but the case is like this:

  1. Try to do something being able to update the data source, such as load more at bottom, pull to refresh
  2. Leave the view after provider received new data, but before finished the animation of update.
  3. When provider trying to update cell view, it'll crash because the tableview is gone.

So we need a method to remove data source and delegate inside provider.

GabrielCartier commented 8 years ago

It was related to not nullifying the delegate properly. You need to force it. On Fri, Jul 15, 2016 at 11:04 NIE, Shanhe notifications@github.com wrote:

I don't remember it clearly, but the case is like this:

  1. Try to do something being able to update the data source, such as load more at bottom, pull to refresh
  2. Leave the view after provider received new data, but before finished the animation of update.
  3. When provider trying to update cell view, it'll crash because the tableview is gone.

So we need a method to remove data source and delegate inside provider.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/samsao/DataProvider/issues/5#issuecomment-232976715, or mute the thread https://github.com/notifications/unsubscribe-auth/AD31_SPzcHKecc3sPDjngzscOtpld-zwks5qV6FzgaJpZM4I4kNH .

AlexHmelevski commented 8 years ago

Ah, so it's not race condition then. I got it.

GabrielCartier commented 8 years ago

Yea it's a deallocation problem more On Fri, Jul 15, 2016 at 11:05 Alex Hmelevski notifications@github.com wrote:

Ah, so it's not race condition then. I got it.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/samsao/DataProvider/issues/5#issuecomment-232977169, or mute the thread https://github.com/notifications/unsubscribe-auth/AD31_Xask424Vul_3muP0b0tLAhVLJjsks5qV6HUgaJpZM4I4kNH .