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

Re #10: Work around bug in Class::Observable observing instances #60

Merged
merged 1 commit into from
Jan 24, 2021

Conversation

ehuelsmann
Copy link
Member

Description

Works around a bug in Class::Observable where observers are registered by memory address and not cleared when the value at that address is destroyed.

Relates to #10.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project, please see the contribution guidelines.
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) to 79.053% when pulling b757898 on ehuelsmann:issue-10 into d15d9ac on jonasbn:master.

@jonasbn jonasbn self-requested a review January 24, 2021 11:28
Copy link
Collaborator

@jonasbn jonasbn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, looking forward to seeing the results from the CPAN-testers. Hopefully the heisenbug is gone. Upstream changes might be forthcoming

@jonasbn jonasbn merged commit b702188 into perl-workflow:master Jan 24, 2021
@ehuelsmann ehuelsmann deleted the issue-10 branch January 24, 2021 18:34
@jonasbn jonasbn added this to the 1.50 milestone Jan 29, 2021
@jonasbn jonasbn linked an issue Jan 29, 2021 that may be closed by this pull request
@ap
Copy link

ap commented Jan 29, 2021

Given that #61 was merged, and so there is no longer a delete_all_observers method, this should be reverted.

It appears to work fine, but that’s only because the eval is swallowing the exception caused by the attempt to invoke a missing method. The exception even ends up not being observable at all, due to the fact that Perl >= 5.14 throws away changes to $@ that happen within a DESTROY.

Nevertheless – the method does run during destruction, it does set up an eval context, and it does try to find the delete_all_observers method, which is all completely pointless.

@ehuelsmann
Copy link
Member Author

Yup. Thanks for pointing that out.

jonasbn pushed a commit that referenced this pull request Jan 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

observers test fail
4 participants