-
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix defining object finalizer in Ruby 3.1 to reference a UUID string
In Ruby 3.1, accessing callback_queue from a finalizer causes an "undefined local variable or method `callback_queue' for FiniteMachine::Observer:Class (NameError)", and callback_queue is never cleaned up. However, making the finalizer an instance method rather than a class method throws a warning about the improper use of finalizers. Hence, using the UUID string as an object to check before it is destroyed by garbage collection for when to call the finalizer proc. --------- Co-authored-by: Piotr Murach <[email protected]>
- Loading branch information
1 parent
8b1e421
commit 11dd7f1
Showing
2 changed files
with
35 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters