Skip to content

Commit

Permalink
Move cancelRequest_ in move ctor in ImageRequest (facebook#37221)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebook#37221

changelog: [internal]

Add missing cancelRequest_ std::move.

Reviewed By: javache, cortinico

Differential Revision: D45524704

fbshipit-source-id: 269674caf09ba0d58b3457af629fc27b080c124c
  • Loading branch information
sammy-SC authored and facebook-github-bot committed May 3, 2023
1 parent 71fbb0c commit f312cf3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class ImageRequest final {
/*
* The move constructor.
*/
ImageRequest(ImageRequest &&other) noexcept;
ImageRequest(ImageRequest &&other) noexcept = default;

/*
* `ImageRequest` does not support copying by design.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ ImageRequest::ImageRequest(
// Not implemented.
}

ImageRequest::ImageRequest(ImageRequest &&other) noexcept
: imageSource_(std::move(other.imageSource_)),
telemetry_(std::move(other.telemetry_)),
coordinator_(std::move(other.coordinator_)) {
// Not implemented.
}

ImageRequest::~ImageRequest() {
// Not implemented.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ ImageRequest::ImageRequest(
coordinator_ = std::make_shared<ImageResponseObserverCoordinator>();
}

ImageRequest::ImageRequest(ImageRequest &&other) noexcept
: imageSource_(std::move(other.imageSource_)),
telemetry_(std::move(other.telemetry_)),
coordinator_(std::move(other.coordinator_)) {
other.coordinator_ = nullptr;
other.cancelRequest_ = nullptr;
other.telemetry_ = nullptr;
other.imageSource_ = {};
}

ImageRequest::~ImageRequest() {
if (cancelRequest_) {
cancelRequest_();
Expand Down

0 comments on commit f312cf3

Please sign in to comment.