Make a class object unreachable

Bug #1808654 reported by Michał "phoe" Herda
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released

Bug Description

As far as I know the MOP, the following code should cause the finalizer to be called and the message to be printed. However, the finalization does not happen. Therefore I suspect that there are some other strong references to the class object that are not removed by calling SETF FIND-CLASS NIL and REMOVE-DIRECT-SUBCLASS. What would they be?

(defclass foo () ())
(sb-ext:finalize (find-class 'foo)
  (lambda () (print "finalized")))
(sb-mop:finalize-inheritance (find-class 'foo))
(sb-mop:remove-direct-subclass (find-class 'standard-object)
                               (find-class 'foo))
(setf (find-class 'foo) nil)
(sb-ext:gc :full t)
(sb-ext:gc :full t)
(sb-ext:gc :full t)
(sb-ext:gc :full t)

Revision history for this message
Stas Boukarev (stassats) wrote :


Changed in sbcl:
status: New → Fix Committed
Stas Boukarev (stassats)
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.