Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Bug fix to #266 whereby TDRouter could get messaged after deallocation #267

Closed
wants to merge 5 commits into from

Conversation

mz2
Copy link
Contributor

@mz2 mz2 commented Jun 22, 2013

Workaround (fix?) to https://github.com/couchbaselabs/TouchDB-iOS/issues/266 whereby TDRouter could get messaged after deallocation. Problem appears to be caused by a race condition whereby TDRouter's notification observer callback is started on one thread, and the router is deallocated on another (dealloc itself will send -stopNow to and thereby remove the notification observer, but this wasn't threadsafe).

mz2 added 5 commits June 22, 2013 15:58
…/issues/266: TDHTTPResponse -cleanUp should rstop the router from observing notifications. Q: is this a good way to fix - should cleanUp instead set _router to nil or call its -stopNow which does the same, also in a synchronized way?
…chDB-iOS/issues/266: TDHTTPResponse -cleanUp should rstop the router from observing notifications. Q: is this a good way to fix - should cleanUp instead set _router to nil or call its -stopNow which does the same, also in a synchronized way?"

This reverts commit 56aea02.
@mz2
Copy link
Contributor Author

mz2 commented Jun 24, 2013

I'm pretty sure your fix works. I've reverted my changes and applied yours. If you decide to take it in, probably good idea to squash my changes when merging.

@mz2
Copy link
Contributor Author

mz2 commented Jun 24, 2013

Made redundant by 9606ce9

@mz2 mz2 closed this Jun 24, 2013
@snej
Copy link
Contributor

snej commented Jun 24, 2013

Since I have my patch in my source tree already, I'll just commit that instead of going through the squashing :) Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants