mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-10-21 08:36:18 +00:00
Do not reschedule a deleted scheduler item
schedule.remove from the scheduled command deletes the item.
This commit is contained in:
@@ -61,14 +61,20 @@ CommandScheduler::call_item(value_type item) {
|
|||||||
// Remove the item before calling the command if it should be
|
// Remove the item before calling the command if it should be
|
||||||
// removed.
|
// removed.
|
||||||
|
|
||||||
|
std::string key = item->key();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
rpc::call_object(item->command());
|
rpc::call_object(item->command());
|
||||||
|
|
||||||
} catch (torrent::input_error& e) {
|
} catch (torrent::input_error& e) {
|
||||||
if (m_slotErrorMessage)
|
if (m_slotErrorMessage)
|
||||||
m_slotErrorMessage("Scheduled command failed: " + item->key() + ": " + e.what());
|
m_slotErrorMessage("Scheduled command failed: " + key + ": " + e.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The command is allowed to erase or replace this item, which deletes it.
|
||||||
|
if (std::find(begin(), end(), item) == end())
|
||||||
|
return;
|
||||||
|
|
||||||
// Still schedule if we caught a torrrent::input_error?
|
// Still schedule if we caught a torrrent::input_error?
|
||||||
auto next = item->next_time_scheduled();
|
auto next = item->next_time_scheduled();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user