Implement close method on share objects