EncodeThread::~EncodeThread(void)
{
	X264_DELETE(m_encoder);
	X264_DELETE(m_jobObject);
	X264_DELETE(m_options);
	X264_DELETE(m_pipedSource);
}
void VapourSynthCheckThread::unload(void)
{
	QMutexLocker lock(&m_vpsLock);

	if(m_vpsLib)
	{
		if(m_vpsLib->isLoaded())
		{
			m_vpsLib->unload();
		}
	}

	if(m_vpsExePath)
	{
		if (m_vpsExePath->isOpen())
		{
			m_vpsExePath->close();
		}
	}

	if(m_vpsDllPath)
	{
		if(m_vpsDllPath->isOpen())
		{
			m_vpsDllPath->close();
		}
	}

	X264_DELETE(m_vpsExePath);
	X264_DELETE(m_vpsDllPath);
	X264_DELETE(m_vpsLib);
}
void AvisynthCheckThread::unload(void)
{
	QMutexLocker lock(&m_avsLock);

	if(m_avsLib)
	{
		if(m_avsLib->isLoaded())
		{
			m_avsLib->unload();
		}
	}

	X264_DELETE(m_avsLib);
}
IPCThread::~IPCThread(void)
{
	X264_DELETE(m_semaphore_r);
	X264_DELETE(m_semaphore_w);
	X264_DELETE(m_sharedMem);
}