示例#1
0
 Instance::~Instance() noexcept
 {
     if(m_ptr && m_count && --(*m_count) == 0)
     {
         Pd::lock();
         releaseDsp();
         delete m_count;
         pdinstance_free(reinterpret_cast<t_pdinstance *>(m_ptr));
         Pd::unlock();
         
         m_ptr   = nullptr;
         m_count =nullptr;
     }
 }
示例#2
0
void cpd_clear()
{
    if(c_sample_ins)
    {
        freebytes(c_sample_ins, (sys_inchannels ? sys_inchannels : 2) * (DEFDACBLKSIZE * sizeof(t_sample)));
    }
    if(c_sample_outs)
    {
        freebytes(c_sample_outs, (sys_outchannels ? sys_outchannels : 2) * (DEFDACBLKSIZE * sizeof(t_sample)));
    }
    if(c_first_instance)
    {
        pdinstance_free(c_first_instance);
    }
    cpd_mutex_destroy(&c_mutex);
}
示例#3
0
 Instance& Instance::operator=(Instance const& other) noexcept
 {
     if(m_ptr && m_count && --(*m_count) == 0)
     {
         Pd::lock();
         releaseDsp();
         delete m_count;
         pdinstance_free(reinterpret_cast<t_pdinstance *>(m_ptr));
         Pd::unlock();
         
         m_ptr   = nullptr;
         m_count =nullptr;
     }
     if(other.m_ptr && other.m_count)
     {
         ++(*m_count);
         m_ptr   = other.m_ptr;
         m_count = other.m_count;
     }
     return *this;
 }
示例#4
0
 void freeContext() {
     pdinstance_free(pdContext.thisPdInstance);
 }