Skip to content

Commit

Permalink
Delete ImageRequest::~ImageRequest (#37222)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #37222

changelog: [internal]

User defined destructor does not make sense here. ImageRequest is owned by ImageState, which is owned by ImageShadowNode. ImageShadowNode requires garbage collection from the runtime to be destroyed. Calling cancel in dtor is not deterministic and that is undesired.

bypass-github-export-checks

Reviewed By: javache

Differential Revision: D45524705

fbshipit-source-id: 410def2100f479b68682620b2c43071fdfb86715
  • Loading branch information
sammy-SC authored and facebook-github-bot committed May 4, 2023
1 parent 9132d7a commit 0688458
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ class ImageRequest final {
*/
ImageRequest(const ImageRequest &other) = delete;

~ImageRequest();

/**
* Set cancelation function.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ ImageRequest::ImageRequest(
// Not implemented.
}

ImageRequest::~ImageRequest() {
// Not implemented.
}

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

ImageRequest::~ImageRequest() {
if (cancelRequest_) {
cancelRequest_();
}
}

void ImageRequest::setCancelationFunction(
std::function<void(void)> cancelationFunction) {
cancelRequest_ = cancelationFunction;
Expand Down

0 comments on commit 0688458

Please sign in to comment.