Move impl_ instance instead create new one.
Change-Id: I590ac591ff463fc6f0945eb6691313da180a738f
Signed-off-by: Sangyoon Jang <jeremy.jang@samsung.com>
}
Bundle::~Bundle() {
- if (impl_->handle_ && (impl_->own_ || impl_->copy_))
+ if (impl_ && impl_->handle_ && (impl_->own_ || impl_->copy_))
bundle_free(impl_->handle_);
}
}
Bundle::Bundle(Bundle&& b) noexcept {
- impl_ = std::unique_ptr<Impl>(new Impl(this));
- impl_->handle_ = b.impl_->handle_;
- b.impl_->handle_ = nullptr;
+ impl_ = std::move(b.impl_);
+ impl_->parent_ = this;
}
Bundle& Bundle::operator = (Bundle&& b) noexcept {