mirror of
https://github.com/nzbget/nzbget.git
synced 2026-04-19 20:36:52 -04:00
fixed: the program could crash during executing of queue-scripts (bug introduced in r1094); the list of queue-scripts is now read only once, at program start; queue-scripts added to scripts-directory after the program was started can be selected in download details dialog on page "Postprocess" but will not be executed until the program is restarted
This commit is contained in:
@@ -459,7 +459,6 @@ QueueScriptCoordinator::~QueueScriptCoordinator()
|
||||
|
||||
void QueueScriptCoordinator::InitOptions()
|
||||
{
|
||||
m_ScriptList.Clear();
|
||||
g_pOptions->LoadScriptList(&m_ScriptList);
|
||||
|
||||
m_bHasQueueScripts = false;
|
||||
@@ -476,20 +475,13 @@ void QueueScriptCoordinator::InitOptions()
|
||||
|
||||
void QueueScriptCoordinator::EnqueueScript(NZBInfo* pNZBInfo, EEvent eEvent)
|
||||
{
|
||||
m_mutexQueue.Lock();
|
||||
|
||||
if (eEvent == qeNzbAdded || eEvent == qeNzbDownloaded)
|
||||
{
|
||||
// reread script list on important events
|
||||
InitOptions();
|
||||
}
|
||||
|
||||
if (!m_bHasQueueScripts)
|
||||
{
|
||||
m_mutexQueue.Unlock();
|
||||
return;
|
||||
}
|
||||
|
||||
m_mutexQueue.Lock();
|
||||
|
||||
if (eEvent == qeNzbDownloaded)
|
||||
{
|
||||
// delete all other queued scripts for this nzb
|
||||
|
||||
Reference in New Issue
Block a user