Skip to content
Snippets Groups Projects
  • Nat Goodspeed's avatar
    47ec6ab3
    SL-11216: Remove LLSingletonBase::cleanupAll(). · 47ec6ab3
    Nat Goodspeed authored
    Remove call from LLAppViewer::cleanup().
    
    Instead, make each LLSingleton<T>::deleteSingleton() call cleanupSingleton()
    just before destroying the instance. Since deleteSingleton() is not a
    destructor, it's fine to call cleanupSingleton() from there; and since
    deleteAll() calls deleteSingleton() on every remaining instance, the former
    cleanupAll() functionality has been subsumed into deleteAll().
    
    Since cleanupSingleton() is now called at exactly one point in the instance's
    lifetime, we no longer need a bool indicating whether it has been called.
    
    The previous protocol of calling cleanupAll() before deleteAll() implemented a
    two-phase cleanup strategy for the application. That is no longer needed.
    Moreover, the cleanupAll() / deleteAll() sequence created a time window during
    which individual LLSingleton<T> instances weren't usable (to the extent that
    their cleanupSingleton() methods released essential resources) but still
    existed -- so a getInstance() call would return the crippled instance rather
    than recreating it.
    
    Remove cleanupAll() calls from tests; adjust to new order of expected side
    effects: instead of A::cleanupSingleton(), B::cleanupSingleton(), ~A(), ~B(),
    now we get A::cleanupSingleton(), ~A(), B::cleanupSingleton(), ~B().
    47ec6ab3
    History
    SL-11216: Remove LLSingletonBase::cleanupAll().
    Nat Goodspeed authored
    Remove call from LLAppViewer::cleanup().
    
    Instead, make each LLSingleton<T>::deleteSingleton() call cleanupSingleton()
    just before destroying the instance. Since deleteSingleton() is not a
    destructor, it's fine to call cleanupSingleton() from there; and since
    deleteAll() calls deleteSingleton() on every remaining instance, the former
    cleanupAll() functionality has been subsumed into deleteAll().
    
    Since cleanupSingleton() is now called at exactly one point in the instance's
    lifetime, we no longer need a bool indicating whether it has been called.
    
    The previous protocol of calling cleanupAll() before deleteAll() implemented a
    two-phase cleanup strategy for the application. That is no longer needed.
    Moreover, the cleanupAll() / deleteAll() sequence created a time window during
    which individual LLSingleton<T> instances weren't usable (to the extent that
    their cleanupSingleton() methods released essential resources) but still
    existed -- so a getInstance() call would return the crippled instance rather
    than recreating it.
    
    Remove cleanupAll() calls from tests; adjust to new order of expected side
    effects: instead of A::cleanupSingleton(), B::cleanupSingleton(), ~A(), ~B(),
    now we get A::cleanupSingleton(), ~A(), B::cleanupSingleton(), ~B().
Code owners
Assign users and groups as approvers for specific file changes. Learn more.