moved cleanup method to GObject and NativeObject