Change-Id: I930fdef4d8f3734c84e61f0c968d74ffa0dbdeb9
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
}
Bundle& operator = (Bundle&& b) {
- raw_ = b.raw_;
- b.raw_ = nullptr;
+ if (this != &b) {
+ if (raw_)
+ bundle_free(raw_);
+
+ raw_ = b.raw_;
+ b.raw_ = nullptr;
+ }
return *this;
}
Bundle(const Bundle& b) : raw_(bundle_dup(b.GetHandle())) {}
Bundle& operator = (const Bundle& b) {
- raw_ = bundle_dup(b.GetHandle());
+ if (this != &b) {
+ if (raw_)
+ bundle_free(raw_);
+
+ raw_ = bundle_dup(b.GetHandle());
+ }
return *this;
}