1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-12 15:14:12 +00:00

Fixing bug in when closing new torrent options dialog (#7247)

This commit is contained in:
cloppingemu 2024-12-25 08:36:12 +11:00 committed by GitHub
parent 2ba8cccfa7
commit dc6c761c29
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -73,7 +73,7 @@ public:
Glib::RefPtr<Gtk::Builder> const& builder, Glib::RefPtr<Gtk::Builder> const& builder,
Glib::RefPtr<Session> const& core, Glib::RefPtr<Session> const& core,
std::unique_ptr<tr_ctor, void (*)(tr_ctor*)> ctor); std::unique_ptr<tr_ctor, void (*)(tr_ctor*)> ctor);
~Impl() = default; ~Impl();
TR_DISABLE_COPY_MOVE(Impl) TR_DISABLE_COPY_MOVE(Impl)
@ -102,6 +102,11 @@ private:
FreeSpaceLabel* freespace_label_ = nullptr; FreeSpaceLabel* freespace_label_ = nullptr;
}; };
OptionsDialog::Impl::~Impl()
{
removeOldTorrent();
}
void OptionsDialog::Impl::removeOldTorrent() void OptionsDialog::Impl::removeOldTorrent()
{ {
if (tor_ != nullptr) if (tor_ != nullptr)
@ -133,10 +138,7 @@ void OptionsDialog::Impl::addResponseCB(int response)
} }
gtr_save_recent_dir("download", core_, downloadDir_); gtr_save_recent_dir("download", core_, downloadDir_);
} tor_ = nullptr;
else if (response == TR_GTK_RESPONSE_TYPE(CANCEL))
{
removeOldTorrent();
} }
} }