device: use dispose to unref the objects