added refCount() method to Ptr
restored original behaviour or release functions for (Buffer and Texture)