Wrapper PAS specific close function in BBThread cleanup(). Ideally nothing in main should have knowledge of pasBB.bb or pasBB.pas. Then references to both headers can be removed.