mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Move cancelRequest_ in move ctor in ImageRequest (#37221)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/37221 changelog: [internal] Add missing cancelRequest_ std::move. bypass-github-export-checks Reviewed By: javache, cortinico Differential Revision: D45524704 fbshipit-source-id: 1dd0d627549dab353872654d78f7b59d1b2d7174
This commit is contained in:
committed by
Lorenzo Sciandra
parent
9cb7b44d4c
commit
8d6d34644a
@@ -35,7 +35,7 @@ class ImageRequest final {
|
||||
/*
|
||||
* The move constructor.
|
||||
*/
|
||||
ImageRequest(ImageRequest &&other) noexcept;
|
||||
ImageRequest(ImageRequest &&other) noexcept = default;
|
||||
|
||||
/*
|
||||
* `ImageRequest` does not support copying by design.
|
||||
|
||||
-7
@@ -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.
|
||||
}
|
||||
|
||||
-10
@@ -17,16 +17,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_();
|
||||
|
||||
Reference in New Issue
Block a user