Calling get() on a unique pointer after
it has been moved is the undefined behavior.
Change-Id: I6878daf840079b59c6584c5741171d1affc71666
Signed-off-by: jykeon <jykeon@samsung.com>
cout << "The PNG file is not loaded correctly. Did you enable PNG Loader?" << endl;
return;
}
- if (canvas->push(move(picture)) == tvg::Result::Success) {
- pPicture = picture.get();
+ pPicture = picture.get();
+ if (canvas->push(move(picture)) != tvg::Result::Success) {
+ pPicture = nullptr;
}
}
cout << "The PNG file is not loaded correctly. Did you enable PNG Loader?" << endl;
return;
}
- if (canvas->push(move(picture)) == tvg::Result::Success) {
- pPicture = picture.get();
+ pPicture = picture.get();
+ if (canvas->push(move(picture)) != tvg::Result::Success) {
+ pPicture = nullptr;
}
}