• Kevin Modzelewski's avatar
    Try to fix set-dtor segfault · 3b44af6b
    Kevin Modzelewski authored
    The issue is that the set destructor, which is marked as "safe",
    will try to access the type object.  But a safe destructor is not
    allowed to assume that any objects are alive, including its own class.
    
    We do actually force the class to be alive during a safe destructor,
    but the tp_mro field was not so lucky.  We could try to address this by
    saying again that types have ordered finalizers, which will cause them
    to also keep their references alive.  But this doesn't completely work
    since it will cause issues with objects that have actual ordered finalizers.
    
    So for now, just remove type-check from the destructor.
    3b44af6b
types.h 39.2 KB