Skip to content

Commit

Permalink
style(*): remove redundant nullptr checks on object deletion (#1288)
Browse files Browse the repository at this point in the history
Signed-off-by: k4yt3x <[email protected]>
  • Loading branch information
k4yt3x committed Jan 8, 2025
1 parent 8ffe1b8 commit e709688
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 12 deletions.
5 changes: 1 addition & 4 deletions src/filter_realcugan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ FilterRealcugan::FilterRealcugan(
model_name_(std::move(model_name)) {}

FilterRealcugan::~FilterRealcugan() {
if (realcugan_) {
delete realcugan_;
realcugan_ = nullptr;
}
delete realcugan_;
}

int FilterRealcugan::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) {
Expand Down
5 changes: 1 addition & 4 deletions src/filter_realesrgan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ FilterRealesrgan::FilterRealesrgan(
model_name_(std::move(model_name)) {}

FilterRealesrgan::~FilterRealesrgan() {
if (realesrgan_) {
delete realesrgan_;
realesrgan_ = nullptr;
}
delete realesrgan_;
}

int FilterRealesrgan::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) {
Expand Down
5 changes: 1 addition & 4 deletions src/interpolator_rife.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ InterpolatorRIFE::InterpolatorRIFE(
model_name_(std::move(model_name)) {}

InterpolatorRIFE::~InterpolatorRIFE() {
if (rife_) {
delete rife_;
rife_ = nullptr;
}
delete rife_;
}

int InterpolatorRIFE::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) {
Expand Down

0 comments on commit e709688

Please sign in to comment.