Repository navigation
Fix reference cycle between Table and Column - #2879
Conversation
|
Note: This doesn't fully resolve #2877 which reported a segfault. But it does lessen the impact. |
|
A note I would like to add about the regression test for this. To quote the docs:
Because the test defines a subclass of |
9805e74 to
d2697ef
Compare
|
@embray - I didn't look in detail at what you did, but if |
|
I don't think so. As I understand it Rows are fairly lightweight objects that are only created when a table is indexed. The Row contains a reference to the table it came from, but the table does not keep a reference to the Row object. So there is no reference cycle. |
|
@embray - a, yes, I didn't think it through properly; makes sense that |
|
👍 |
…t_table as a weakref. This is achievable since most of the Column class seems to work find if there isn't a parent_table. Also makes parent_table a property, allowing minimal changes elsewhere.
d2697ef to
9237d6b
Compare
|
Weird that I had to rebase this since there were no merge conflicts. Oh well. |
|
Looks fine to me. |
Fix reference cycle between Table and Column
Fix misplayed changelog entry for #2879
Fix reference cycle between Table and Column Conflicts: CHANGES.rst
As discovered while looking into #2877 there is a reference cycle that goes:
Table->TableColumns->Column->Tableby way of the
parent_tableattribute on columns. This fixes it by makingparent_tablea weakref (hidden away via apropertyallowing minimal code changes elsewhere). A test demonstrating the fix is included.