Code Monkey home page Code Monkey logo

Comments (2)

marshallxxx avatar marshallxxx commented on July 17, 2024

No, in this case there is no retain cycle.

Observable.create { observer in
			
			let observerAdapter = FetchedResultsControllerEntityObserver(observer: observer, fetchRequest: fetchRequest, managedObjectContext: self.base, sectionNameKeyPath: sectionNameKeyPath, cacheName: cacheName)
			
			return Disposables.create {
				observerAdapter.dispose()
			}
        }

Observer is retained by Observable and FetchedResultsControllerEntityObserver
FetchedResultsControllerEntityObserver is retained by Observable, it has a reference in Disposable
As soon as Observable will be deallocated, FetchedResultsControllerEntityObserver will have no other reference which will release it. Then Observer will be released as well.

from rxcoredata.

isidorebaldado avatar isidorebaldado commented on July 17, 2024

Oh, so the Observable owns the Observer. And FetchedResultsControllerEntityObserver is also owned by the Observable, so it's all down stream and will be deallocated with Observable. That makes a lot of sense. Thank you for your explanation.

from rxcoredata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.