Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table Destructor #3707

Merged
merged 2 commits into from
Sep 3, 2023
Merged

Table Destructor #3707

merged 2 commits into from
Sep 3, 2023

Conversation

oleibman
Copy link
Collaborator

@oleibman oleibman commented Sep 2, 2023

There is a circular reference between Worksheet and Table, which can lead to a memory leak. I tried to break this connection in the Worksheet destructor earlier, but this seemed to cause some sort of error with Phpunit 10 on Github, an error that I am unable to duplicate in my local environments. This PR will allow me to explore the problem to see if I can come up with any useful diagnostic data. If I get to a combination that works, I will consider merging it.

This is:

  • a bugfix
  • a new feature
  • refactoring
  • additional unit tests

Checklist:

  • Changes are covered by unit tests
    • Changes are covered by existing unit tests
    • New unit tests have been added
  • Code style is respected
  • Commit message explains why the change is made (see https://github.com/erlang/otp/wiki/Writing-good-commit-messages)
  • CHANGELOG.md contains a short summary of the change and a link to the pull request if applicable
  • Documentation is updated as necessary

Why this change is needed?

Provide an explanation of why this change is needed, with links to any Issues (if appropriate).
If this is a bugfix or a new feature, and there are no existing Issues, then please also create an issue that will make it easier to track progress with this PR.

There is a circular reference between Worksheet and Table, which can lead to a memory leak. I tried to break this connection in the Worksheet destructor earlier, but this seemed to cause some sort of error with Phpunit 10 on Github, an error that I am unable to duplicate in my local environments. This PR will allow me to explore the problem to see if I can come up with any useful diagnostic data. If I get to a combination that works, I will consider merging it.
@oleibman oleibman marked this pull request as draft September 2, 2023 14:23
@oleibman
Copy link
Collaborator Author

oleibman commented Sep 2, 2023

This seems to have worked, so I am moving it out of draft status. Differences between this and prior attempt:

  • Don't know if this is a different version of Phpunit 10.
  • Added destructor to Table. I can't see why this would matter, but other descendants of Worksheet with potential circular references (e.g. Row and Column) do so.
  • Changed Worksheet destructor to empty Table collection directly rather than calling a subroutine which returns self. I can sort of convince myself that this is the change that mattered if I don't think about it too much.

@oleibman oleibman changed the title WIP Table Destructor Table Destructor Sep 2, 2023
@oleibman oleibman marked this pull request as ready for review September 2, 2023 14:35
@oleibman oleibman merged commit 7288b4d into PHPOffice:master Sep 3, 2023
@oleibman oleibman deleted the tabledestruct branch September 3, 2023 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant