Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
queryset: Fix circular reference error
This fixes an error where the ModelInstanceManager maintained a reference to the QuerySet instance, and the QuerySet instance managed a reference to the ModelInstanceManager instance (if it's the iterator for the query). Because of the circular reference, if the iterator is not exhausted, then the resource is not closed and the query remains open. This wastes memory and prevents some other queries from running after such a situation happens. This addresses the issue by removing the circular reference between the QuerySet and the ModelInstanceManager.
- Loading branch information