style(*): remove redundant nullptr checks on object deletion (#1288)

Signed-off-by: k4yt3x <i@k4yt3x.com>
This commit is contained in:
k4yt3x 2025-01-08 00:00:00 +00:00
parent 8ffe1b84bd
commit e7096887ed
No known key found for this signature in database
3 changed files with 3 additions and 12 deletions

View File

@ -32,10 +32,7 @@ FilterRealcugan::FilterRealcugan(
model_name_(std::move(model_name)) {} model_name_(std::move(model_name)) {}
FilterRealcugan::~FilterRealcugan() { FilterRealcugan::~FilterRealcugan() {
if (realcugan_) { delete realcugan_;
delete realcugan_;
realcugan_ = nullptr;
}
} }
int FilterRealcugan::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) { int FilterRealcugan::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) {

View File

@ -26,10 +26,7 @@ FilterRealesrgan::FilterRealesrgan(
model_name_(std::move(model_name)) {} model_name_(std::move(model_name)) {}
FilterRealesrgan::~FilterRealesrgan() { FilterRealesrgan::~FilterRealesrgan() {
if (realesrgan_) { delete realesrgan_;
delete realesrgan_;
realesrgan_ = nullptr;
}
} }
int FilterRealesrgan::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) { int FilterRealesrgan::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) {

View File

@ -29,10 +29,7 @@ InterpolatorRIFE::InterpolatorRIFE(
model_name_(std::move(model_name)) {} model_name_(std::move(model_name)) {}
InterpolatorRIFE::~InterpolatorRIFE() { InterpolatorRIFE::~InterpolatorRIFE() {
if (rife_) { delete rife_;
delete rife_;
rife_ = nullptr;
}
} }
int InterpolatorRIFE::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) { int InterpolatorRIFE::init(AVCodecContext* dec_ctx, AVCodecContext* enc_ctx, AVBufferRef*) {