Skip to content

Commit

Permalink
break a cyclic reference loop which prevents objects deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
denisri committed May 14, 2020
1 parent 04098ff commit cb46dba
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/populse_db/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import re
import types
from datetime import date, time, datetime
import weakref

import dateutil.parser
import six
Expand Down Expand Up @@ -391,8 +392,8 @@ def __init__(self, database, session):
:param session: Session instance attached to the Database instance
"""

self.database = database
self.session = session
self.database = weakref.proxy(database)
self.session = weakref.proxy(session)

# Database opened
self.metadata = MetaData()
Expand Down

0 comments on commit cb46dba

Please sign in to comment.